summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-01-19 16:53:49 +0100
committerThomas Gleixner <tglx@linutronix.de>2010-02-21 20:20:11 +0100
commit68dd8120041d9120aa8734894c940a25eacf5c9c (patch)
treeebffc3d30c4038195bfabd31a216d292d813d4a8
parent9090f9aca724a2d426c12badc71d25aae95e9797 (diff)
downloadlwn-68dd8120041d9120aa8734894c940a25eacf5c9c.tar.gz
lwn-68dd8120041d9120aa8734894c940a25eacf5c9c.zip
sched: Queue a deboosted task to the head of the RT priority queue
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>
-rw-r--r--kernel/sched.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 8da004bbc8db..8262cf2de797 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6390,7 +6390,7 @@ void task_setprio(struct task_struct *p, int prio)
if (running)
p->sched_class->set_curr_task(rq);
if (on_rq) {
- enqueue_task(rq, p, 0, false);
+ enqueue_task(rq, p, 0, oldprio < prio);
check_class_changed(rq, p, prev_class, oldprio, running);
}