Peter Zijlstra 6ad4c18884 sched: Fix balance vs hotplug race
Since (e761b77: cpu hotplug, sched: Introduce cpu_active_map and redo
sched domain managment) we have cpu_active_mask which is suppose to rule
scheduler migration and load-balancing, except it never (fully) did.

The particular problem being solved here is a crash in try_to_wake_up()
where select_task_rq() ends up selecting an offline cpu because
select_task_rq_fair() trusts the sched_domain tree to reflect the
current state of affairs, similarly select_task_rq_rt() trusts the
root_domain.

However, the sched_domains are updated from CPU_DEAD, which is after the
cpu is taken offline and after stop_machine is done. Therefore it can
race perfectly well with code assuming the domains are right.

Cure this by building the domains from cpu_active_mask on
CPU_DOWN_PREPARE.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-12-06 21:10:56 +01:00
..
2009-09-21 14:29:21 +02:00
2009-06-24 00:02:38 -04:00
2009-10-29 07:39:25 -07:00
2009-12-06 21:10:56 +01:00
2009-12-06 21:10:56 +01:00
2009-09-18 09:48:52 -07:00
2009-06-16 19:47:48 -07:00
2009-08-29 14:10:07 +02:00
2009-09-19 13:13:17 -07:00
2009-07-24 10:53:29 +02:00
2009-06-18 13:03:56 -07:00
2009-10-29 08:56:20 +10:30
2009-09-23 07:39:41 -07:00
2009-11-04 19:13:48 +01:00
2009-11-04 13:16:38 +01:00
2009-12-06 21:10:56 +01:00
2009-11-18 14:52:25 +01:00
2009-10-26 09:40:30 +01:00
2009-07-12 14:03:27 -07:00
2009-11-26 12:59:20 +01:00
2009-09-23 18:13:10 -07:00
2009-11-02 16:02:39 +01:00
2009-06-18 13:03:55 -07:00