aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@SteelEye.com>2007-10-29 16:18:11 -0400
committerIngo Molnar <mingo@elte.hu>2007-10-29 16:18:11 -0400
commit7bae49d498de87f0da0c20c67adaa278eac84566 (patch)
tree29af1dd7d73da9c06e6295debf0bf963085a1589 /kernel/sched.c
parent73a2bcb0edb9ffb0b007b3546b430e2c6e415eee (diff)
sched: fix incorrect assumption that cpu 0 exists
This patch: commit 9b5b77512dce239fa168183fa71896712232e95a Author: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com> Date: Mon Oct 15 17:00:09 2007 +0200 sched: clean up code under CONFIG_FAIR_GROUP_SCHED Introduced an assumption of the existence of CPU0 via this line cfs_rq = tg->cfs_rq[0]; If you have no CPU0, that will be NULL. The fix seems to be just to take whatever cfs_rq queue comes out of the for_each_possible_cpu() loop, since they're all equally good for the destruction operation. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 74dbb4020cf5..235952b100eb 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -7041,7 +7041,7 @@ static void free_sched_group(struct rcu_head *rhp)
7041/* Destroy runqueue etc associated with a task group */ 7041/* Destroy runqueue etc associated with a task group */
7042void sched_destroy_group(struct task_group *tg) 7042void sched_destroy_group(struct task_group *tg)
7043{ 7043{
7044 struct cfs_rq *cfs_rq; 7044 struct cfs_rq *cfs_rq = NULL;
7045 int i; 7045 int i;
7046 7046
7047 for_each_possible_cpu(i) { 7047 for_each_possible_cpu(i) {
@@ -7049,7 +7049,7 @@ void sched_destroy_group(struct task_group *tg)
7049 list_del_rcu(&cfs_rq->leaf_cfs_rq_list); 7049 list_del_rcu(&cfs_rq->leaf_cfs_rq_list);
7050 } 7050 }
7051 7051
7052 cfs_rq = tg->cfs_rq[0]; 7052 BUG_ON(!cfs_rq);
7053 7053
7054 /* wait for possible concurrent references to cfs_rqs complete */ 7054 /* wait for possible concurrent references to cfs_rqs complete */
7055 call_rcu(&cfs_rq->rcu, free_sched_group); 7055 call_rcu(&cfs_rq->rcu, free_sched_group);