Priority Inversion and Priority Inheritance

Trace a three-task lock dependency and explain how inherited priority can reduce delay experienced by a blocked high-priority task.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Lock ownership can create an implicit scheduling dependency
  2. Inherit the priority of waiting work where the protocol permits it

Lock ownership can create an implicit scheduling dependency

A low-priority task holds a lock needed by a high-priority task. The high-priority task blocks and cannot proceed until the low-priority holder runs. A medium-priority runnable task can preempt the holder even though it does not use the lock. The high-priority task is now delayed indirectly by the medium one, despite the scheduler respecting its runnable priority order.

Inherit the priority of waiting work where the protocol permits it

A priority inheritance mutex can temporarily raise a holder’s effective priority to that of a higher-priority waiter. The holder then gets processor time to finish its critical section and release the lock. Nested dependencies may require propagating the inherited priority. Release still depends on the duration and behavior of that section. CPU scheduling determines runnable order. Real-time scheduling makes blocking assumptions explicit in deadline reasoning.[1]

References

  1. Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau, Operating Systems: Three Easy Pieces ↩