Skip to content

Commit df953f9

Browse files
Peter Zijlstragregkh
authored andcommitted
sched: Fix load avg vs. cpu-hotplug
commit 08bedae upstream. Commit f319da0 ("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 303990b commit df953f9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/sched/core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5604,7 +5604,9 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu)
56045604
migrate_tasks(cpu);
56055605
BUG_ON(rq->nr_running != 1); /* the migration thread */
56065606
raw_spin_unlock_irqrestore(&rq->lock, flags);
5607+
break;
56075608

5609+
case CPU_DEAD:
56085610
calc_load_migrate(rq);
56095611
break;
56105612
#endif

0 commit comments

Comments
 (0)