Linux是否使用了一些优先级倒置的方案?

Does Linux use some of the solutions of priority inversion?

众所周知,优先级反转问题 - 当具有较高优先级的线程等待具有较低优先级的线程时:https://en.wikipedia.org/wiki/Priority_inversion

当我们有 3 个线程时会发生这种情况:L(低优先级)、M(中优先级)、H(高优先级)。 L 和 H 使用相同的互斥锁,但 L 比 H 早获得它,H 阻塞并进入休眠状态。然后M占用CPU-core,因为优先级比L高,L进入休眠状态,但是仍然获取到了mutex。 L&H在睡觉,M在工作

有一些solutions的优先级反转:

Linux是否使用了一些优先级倒置的解决方案,使用了哪些?

Linux使用优先继承.

优先级倒置可以用函数解决 int pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr, int protocol);

其中 protocol 是:

When a thread owns one or more mutexes initialized with the PTHREAD_PRIO_PROTECT protocol, it shall execute at the higher of its priority or the highest of the priority ceilings of all the mutexes owned by this thread and initialized with this attribute, regardless of whether other threads are blocked on any of these mutexes or not.