Page MenuHomeFreeBSD

sched_ule: Fix selecting lowest priority thread early in corner case
Needs ReviewPublic

Authored by olce on Wed, Jun 24, 6:45 PM.
Tags
None
Referenced Files
F160578382: D57829.diff
Thu, Jun 25, 9:00 PM
Unknown Object (File)
Wed, Jun 24, 7:46 PM

Details

Summary

When transferring a thread with near 100% CPU statistics (but not 100%;
up to 57.5/59≈97.46%) to a CPU where the enqueue offset is ahead of at
least 2 from the dequeue one, which requires peculiar conditions to
happen (transfer triggered by a bind request or cpuset change, or during
balancing if a thread or more existed from a brief amount of time on the
origin CPU), the transferred thread can get placed after the dequeue
offset, effectively making it appear as a high priority one unduly,
causing latency increase for other threads.

The change here was missed when changing the enqueue and dequeue offsets
update mechanism to recover pre-256-queue-runqueue ULE anti-starvation
and fairness behavior. That change opened up the possibility that these
two offsets are apart by more than one.

Fixes: 6792f3411f6d ("sched_ule: Recover previous nice and anti-starvation behaviors")
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 74212
Build 71095: arc lint + arc unit

Event Timeline

olce requested review of this revision.Wed, Jun 24, 6:45 PM
olce created this revision.
olce retitled this revision from ctld: Simplify handling of non-iSCSI and non-NVMe kernel ports to sched_ule: Fix selecting lowest priority thread early in corner case.
olce edited the summary of this revision. (Show Details)

Good commit this time.

Although it looks improbable, it might be the cause of the observed latency problem at Netflix.