sched/rt: Fix rq's cpupri leak while enqueue/dequeue child RT entities
authorKirill Tkhai <tkhai@yandex.ru>
Wed, 27 Nov 2013 15:59:13 +0000 (19:59 +0400)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 15 Feb 2014 19:20:14 +0000 (19:20 +0000)
commit069623122342d660364e011d1d3e2dfaad18b75d
tree1591471c33b1ae7475761056c3d5035a5f95f580
parent882f85b5380e13093710f5a7ffbe575e85ba8fd8
sched/rt: Fix rq's cpupri leak while enqueue/dequeue child RT entities

commit 757dfcaa41844595964f1220f1d33182dae49976 upstream.

This patch touches the RT group scheduling case.

Functions inc_rt_prio_smp() and dec_rt_prio_smp() change (global) rq's
priority, while rt_rq passed to them may be not the top-level rt_rq.
This is wrong, because changing of priority on a child level does not
guarantee that the priority is the highest all over the rq. So, this
leak makes RT balancing unusable.

The short example: the task having the highest priority among all rq's
RT tasks (no one other task has the same priority) are waking on a
throttle rt_rq.  The rq's cpupri is set to the task's priority
equivalent, but real rq->rt.highest_prio.curr is less.

The patch below fixes the problem.

Signed-off-by: Kirill Tkhai <tkhai@yandex.ru>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
CC: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/49231385567953@web4m.yandex.ru
Signed-off-by: Ingo Molnar <mingo@kernel.org>
[bwh: Backported to 3.2: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
kernel/sched_rt.c