From: Gregory Haskins It is possible to allow the root-domain cache of online cpus to become out of sync with the global cpu_online_map. This is because we currently trigger removal of cpus too early in the notifier chain. Other DOWN_PREPARE handlers may in fact run and reconfigure the root-domain topology, thereby stomping on our own offline handling. The end result is that rd->online may become out of sync with cpu_online_map, which results in potential task misrouting. So change the offline handling to be more tightly coupled with the global offline process by triggering on CPU_DYING intead of CPU_DOWN_PREPARE. Signed-off-by: Gregory Haskins Cc: Gautham R Shenoy Cc: "Siddha, Suresh B" Cc: Ingo Molnar Cc: "Rafael J. Wysocki" Signed-off-by: Andrew Morton --- kernel/sched.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff -puN kernel/sched.c~keep-rd-online-and-cpu_online_map-in-sync kernel/sched.c --- a/kernel/sched.c~keep-rd-online-and-cpu_online_map-in-sync +++ a/kernel/sched.c @@ -5956,7 +5956,8 @@ migration_call(struct notifier_block *nf spin_unlock_irq(&rq->lock); break; - case CPU_DOWN_PREPARE: + case CPU_DYING: + case CPU_DYING_FROZEN: /* Update our root-domain */ rq = cpu_rq(cpu); spin_lock_irqsave(&rq->lock, flags); _