[patch] sched: fix unregister_fair_sched_group

From: Paul Turner
Date: Mon Nov 29 2010 - 19:59:12 EST


In the flipping and flopping between calling unregister_fair_sched_group on a
per-cpu versus per-group basis we ended up in a bad state.

Remove from the list for the passed cpu as opposed to some arbitrary index.

(This fixes explosions w/ autogroup as well as a group creation/destruction
stress test)

Signed-off-by: Paul Turner <pjt@xxxxxxxxxx>
---
kernel/sched.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

Index: tip/kernel/sched.c
===================================================================
--- tip.orig/kernel/sched.c
+++ tip/kernel/sched.c
@@ -8097,7 +8097,6 @@ static inline void unregister_fair_sched
{
struct rq *rq = cpu_rq(cpu);
unsigned long flags;
- int i;

/*
* Only empty task groups can be destroyed; so we can speculatively
@@ -8107,7 +8106,7 @@ static inline void unregister_fair_sched
return;

raw_spin_lock_irqsave(&rq->lock, flags);
- list_del_leaf_cfs_rq(tg->cfs_rq[i]);
+ list_del_leaf_cfs_rq(tg->cfs_rq[cpu]);
raw_spin_unlock_irqrestore(&rq->lock, flags);
}
#else /* !CONFG_FAIR_GROUP_SCHED */


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/