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
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
Unknown Object (File)
Oct 2 2024, 4:43 AM
Unknown Object (File)
Oct 1 2024, 2:23 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.