diff options
author | Peter Zijlstra <peterz@infradead.org> | 2012-09-05 18:03:50 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-09-13 10:52:05 -0400 |
commit | 08bedae1d0acd8c9baf514fb69fa199d0c8345f6 (patch) | |
tree | 82cda177bc9c52658d350c9686ea2b8b07b8ee5b /kernel/sched | |
parent | f3e947867478af9a12b9956bcd000ac7613a8a95 (diff) |
sched: Fix load avg vs. cpu-hotplug
Commit f319da0c68 ("sched: Fix load avg vs cpu-hotplug") was an
incomplete fix:
In particular, the problem is that at the point it calls
calc_load_migrate() nr_running := 1 (the stopper thread), so move the
call to CPU_DEAD where we're sure that nr_running := 0.
Also note that we can call calc_load_migrate() without serialization, we
know the state of rq is stable since its cpu is dead, and we modify the
global state using appropriate atomic ops.
Suggested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1346882630.2600.59.camel@twins
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 8b51b2d9b1fd..ba144b121f3d 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -5048,7 +5048,9 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu) | |||
5048 | migrate_tasks(cpu); | 5048 | migrate_tasks(cpu); |
5049 | BUG_ON(rq->nr_running != 1); /* the migration thread */ | 5049 | BUG_ON(rq->nr_running != 1); /* the migration thread */ |
5050 | raw_spin_unlock_irqrestore(&rq->lock, flags); | 5050 | raw_spin_unlock_irqrestore(&rq->lock, flags); |
5051 | break; | ||
5051 | 5052 | ||
5053 | case CPU_DEAD: | ||
5052 | calc_load_migrate(rq); | 5054 | calc_load_migrate(rq); |
5053 | break; | 5055 | break; |
5054 | #endif | 5056 | #endif |