diff options
author | Bianca Lutz <sowilo@cs.tu-berlin.de> | 2011-07-13 14:13:36 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-07-21 12:01:51 -0400 |
commit | 99bc52429f11d1f4f81495ac8237085aaeb6bccf (patch) | |
tree | af5b2f44ceb1382b836dc9171fe296b3d35dd48d | |
parent | 045176d22f08bc0b650a028df0f62fc3c2747699 (diff) |
sched: Do not attempt to destroy uninitialized rt_bandwidth
If a task group is to be created and alloc_fair_sched_group() fails,
then the rt_bandwidth of the corresponding task group is not yet
initialized. The caller, sched_create_group(), starts a clean up
procedure which calls free_rt_sched_group() which unconditionally
destroys the not yet initialized rt_bandwidth.
This crashes or hangs the system in lock_hrtimer_base(): UP systems
dereference a NULL pointer, while SMP systems loop endlessly on a
condition that cannot become true.
This patch simply avoids the destruction of rt_bandwidth when the
initialization code path was not reached.
(This was discovered by accident with a custom kernel modification.)
Signed-off-by: Bianca Lutz <sowilo@cs.tu-berlin.de>
Signed-off-by: Jan Schoenherr <schnhrr@cs.tu-berlin.de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1310580816-10861-7-git-send-email-schnhrr@cs.tu-berlin.de
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | kernel/sched.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 3b3826ebe793..f107204db53f 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -8383,7 +8383,8 @@ static void free_rt_sched_group(struct task_group *tg) | |||
8383 | { | 8383 | { |
8384 | int i; | 8384 | int i; |
8385 | 8385 | ||
8386 | destroy_rt_bandwidth(&tg->rt_bandwidth); | 8386 | if (tg->rt_se) |
8387 | destroy_rt_bandwidth(&tg->rt_bandwidth); | ||
8387 | 8388 | ||
8388 | for_each_possible_cpu(i) { | 8389 | for_each_possible_cpu(i) { |
8389 | if (tg->rt_rq) | 8390 | if (tg->rt_rq) |