• Gregory Haskins's avatar
    rtmutex: Add lateral lock stealing · 74804766
    Gregory Haskins authored
    The current logic only allows lock stealing to occur if the current task
    is of higher priority than the pending owner. We can gain signficant
    throughput improvements (200%+) by allowing the lock-stealing code to
    include tasks of equal priority.  The theory is 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, yes.  But also note that the users
    of these locks under non -rt environments have already been using unfair
    raw spinlocks anyway so the tradeoff is probably worth it.
    
    The way I like to think of this is that higher priority tasks should
    clearly preempt, and lower priority tasks should clearly block.  However,
    if tasks have an identical priority value, then we can think of the
    scheduler decisions as the tie-breaking parameter. (e.g. tasks that the
    scheduler picked to run first have a logically higher priority amoung tasks
    of the same prio).  This helps to keep the system "primed" with tasks doing
    useful work, and the end result is higher throughput.
    
    Thanks to Steven Rostedt for pointing out that RT tasks should be excluded
    to prevent the introduction of an unnatural unbounded latency.
    
    [ Steven Rostedt - removed config option to disable ]
    Signed-off-by: default avatarGregory Haskins <ghaskins@novell.com>
    Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    74804766
rtmutex_common.h 4.13 KB