]> git.baikalelectronics.ru Git - kernel.git/commit
locking/rtmutex: Implement equal priority lock stealing
authorGregory Haskins <ghaskins@novell.com>
Sun, 15 Aug 2021 21:29:23 +0000 (23:29 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 17 Aug 2021 17:06:07 +0000 (19:06 +0200)
commite07c2c83d40fa3b2ea7d0c1bc56a6b453909f91f
tree4899851688cb6f52be2dad5bb544bc3993c00503
parentc357db10d37435ada1293826e8cbacd6c2a0c10c
locking/rtmutex: Implement equal priority lock stealing

The current logic only allows lock stealing to occur if the current task is
of higher priority than the pending owner.

Significant throughput improvements can be gained by allowing the lock
stealing to include tasks of equal priority when the contended lock is a
spin_lock or a rw_lock and the tasks are not in a RT scheduling task.

The assumption was that the system will make faster progress by allowing
the task already on the CPU to take the lock rather than waiting for the
system to wake up a different task.

This does add a degree of unfairness, but in reality no negative side
effects have been observed in the many years that this has been used in the
RT kernel.

[ tglx: Refactored and rewritten several times by Steve Rostedt, Sebastian
   Siewior and myself ]

Signed-off-by: Gregory Haskins <ghaskins@novell.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20210815211305.857240222@linutronix.de
kernel/locking/rtmutex.c