sched_rt: Fix overload bug on rt group scheduling
commitfedb5937d9f132d3a03b12568925967827335d39
authorPeter Zijlstra <peterz@infradead.org>
Wed, 1 Apr 2009 16:40:15 +0000 (1 18:40 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 30 Jul 2009 21:39:52 +0000 (30 14:39 -0700)
tree2cafc1de7361c1f8846dba87f112a0c3f422f6ac
parent23e839dc9cad6ea1d74a26abbf8dca6f785ca193
sched_rt: Fix overload bug on rt group scheduling

commit a1ba4d8ba9f06a397e97cbd67a93ee306860b40a upstream.

Fixes an easily triggerable BUG() when setting process affinities.

Make sure to count the number of migratable tasks in the same place:
the root rt_rq. Otherwise the number doesn't make sense and we'll hit
the BUG in set_cpus_allowed_rt().

Also, make sure we only count tasks, not groups (this is probably
already taken care of by the fact that rt_se->nr_cpus_allowed will be 0
for groups, but be more explicit)

Tested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Gregory Haskins <ghaskins@novell.com>
LKML-Reference: <1247067476.9777.57.camel@twins>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/sched.c
kernel/sched_rt.c