sched: Add new prio to cpupri before removing old prio
authorSteven Rostedt <srostedt@redhat.com>
Wed, 29 Jul 2009 04:21:23 +0000 (00:21 -0400)
committerIngo Molnar <mingo@elte.hu>
Sun, 2 Aug 2009 12:26:09 +0000 (14:26 +0200)
We need to add the new prio to the cpupri accounting before
removing the old prio. This is because removing the old prio
first will open a race window where the cpu will be removed
from pri_active. In this case the cpu will not be visible for
RT push and pulls. This could cause a RT task to not migrate
appropriately, and create a very large latency.

This bug was found with the use of ftrace sched events and
trace_printk.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090729042526.438281019@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched_cpupri.c

Simple merge