Skip to contentSkip to conversation

sched: fix unregister_fair_sched_group

PATCH In review Paul Turner 1 participant 2 messages Nov 30, 2010 1 message not in the archive

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 sched: fix unregister_fair_sched_group

In reply to a message not in the archive

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)

---
 kernel/sched.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/sched.c +1 -2
Index: 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 */
#2 lore raw

[tip:sched/core] sched: Fix unregister_fair_sched_group()

Commit-ID:  822bc180a7f7a7bc5fcaaea195f41b487cc8cae8
Gitweb:     http://git.kernel.org/tip/822bc180a7f7a7bc5fcaaea195f41b487cc8cae8
Author:     Paul Turner <[email protected]>
AuthorDate: Mon, 29 Nov 2010 16:55:40 -0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 30 Nov 2010 10:07:10 +0100

sched: Fix unregister_fair_sched_group()

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. )

LKML-Reference: <[email protected]>

---
 kernel/sched.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
kernel/sched.c +1 -2
index 35a6373..66ef579 100644
@@ -8085,7 +8085,6 @@ static inline void unregister_fair_sched_group(struct task_group *tg, int cpu)
 {
 	struct rq *rq = cpu_rq(cpu);
 	unsigned long flags;
-	int i;
 
 	/*
 	* Only empty task groups can be destroyed; so we can speculatively
@@ -8095,7 +8094,7 @@ static inline void unregister_fair_sched_group(struct task_group *tg, int cpu)
 		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 */