]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
sched: Queue a deboosted task to the head of the RT prio queue
authorThomas Gleixner <tglx@linutronix.de>
Wed, 20 Jan 2010 20:59:06 +0000 (20:59 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 20 Sep 2010 20:18:03 +0000 (13:18 -0700)
commit4b3d9e7ce5a9e6409df1512127feb9973df1ea57
treeb394f21e5cd3ddafda8b4550ae68da4344bd9ffb
parentafc0109e65ee79cf7bd868e8fe98ac60b4d8f09e
sched: Queue a deboosted task to the head of the RT prio queue

commit 60db48cacb9b253d5607a5ff206112a59cd09e34 upstream

rtmutex_set_prio() is used to implement priority inheritance for
futexes. When a task is deboosted it gets enqueued at the tail of its
RT priority list. This is violating the POSIX scheduling semantics:

rt priority list X contains two runnable tasks A and B

task A  runs with priority X and holds mutex M
task C  preempts A and is blocked on mutex M
       -> task A is boosted to priority of task C (Y)
task A  unlocks the mutex M and deboosts itself
       -> A is dequeued from rt priority list Y
 -> A is enqueued to the tail of rt priority list X
task C  schedules away
task B  runs

This is wrong as task A did not schedule away and therefor violates
the POSIX scheduling semantics.

Enqueue the task to the head of the priority list instead.

Reported-by: Mathias Weber <mathias.weber.mw1@roche.com>
Reported-by: Carsten Emde <cbe@osadl.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Tested-by: Carsten Emde <cbe@osadl.org>
Tested-by: Mathias Weber <mathias.weber.mw1@roche.com>
LKML-Reference: <20100120171629.809074113@linutronix.de>
Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/sched.c