Page MenuHomeFreeBSD

Check for preemption after lowering a thread's priority
ClosedPublic

Authored by rstone on Feb 9 2017, 5:53 PM.
Tags
None
Referenced Files
F103641668: D9518.diff
Wed, Nov 27, 1:12 PM
F103624264: D9518.diff
Wed, Nov 27, 7:11 AM
Unknown Object (File)
Oct 20 2024, 1:14 AM
Unknown Object (File)
Oct 20 2024, 1:14 AM
Unknown Object (File)
Oct 20 2024, 1:14 AM
Unknown Object (File)
Oct 20 2024, 12:55 AM
Unknown Object (File)
Oct 4 2024, 5:06 AM
Unknown Object (File)
Oct 4 2024, 4:05 AM

Details

Summary

When a high-priority thread is waiting for a mutex held by a
low-priority thread, it temporarily lends its priority to the
low-priority thread to prevent priority inversion. When the mutex
is released, the lent priority is revoked and the low-priority
thread goes back to its original priority.

When the priority of that thread is lowered (through a call to
sched_priority()), the schedule was not checking whether
there is now a high-priority thread in the run queue. This can
cause threads with real-time priority to be starved in the run
queue while the low-priority thread finishes its quantum.

Fix this by explicitly checking whether preemption is necessary
when a thread's priority is lowered.

Sponsored by: Dell EMC Isilon

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7319
Build 7487: arc lint + arc unit

Event Timeline

rstone retitled this revision from to Check for preemption after lowering a thread's priority.
rstone edited the test plan for this revision. (Show Details)
rstone updated this object.
This comment was removed by rstone.
This revision was automatically updated to reflect the committed changes.