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
F81925903: D9518.diff
Tue, Apr 23, 7:03 AM
Unknown Object (File)
Thu, Apr 18, 7:55 AM
Unknown Object (File)
Jan 5 2024, 1:05 PM
Unknown Object (File)
Jan 5 2024, 1:05 PM
Unknown Object (File)
Jan 5 2024, 1:05 PM
Unknown Object (File)
Jan 3 2024, 9:54 PM
Unknown Object (File)
Dec 27 2023, 4:20 PM
Unknown Object (File)
Dec 27 2023, 4:20 PM

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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.