Commit a4d53cb7 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] Hotplug CPUs: don't pull onto offline CPUs

Don't move tasks onto offline cpus in load_balance and wake_task (the
latter is caused by a completion run from stop_machine).

Note that cpu_is_offline() is a noop when CONFIG_HOTPLUG_CPU=n.
parent edf19689
......@@ -666,8 +666,8 @@ static int try_to_wake_up(task_t * p, unsigned int state, int sync)
if (unlikely(sync && !task_running(rq, p) &&
(task_cpu(p) != smp_processor_id()) &&
cpu_isset(smp_processor_id(),
p->cpus_allowed))) {
p->cpus_allowed) &&
!cpu_is_offline(smp_processor_id()))) {
set_task_cpu(p, smp_processor_id());
task_rq_unlock(rq, &flags);
goto repeat_lock_task;
......@@ -1299,6 +1299,9 @@ static void load_balance(runqueue_t *this_rq, int idle, cpumask_t cpumask)
struct list_head *head, *curr;
task_t *tmp;
if (cpu_is_offline(this_cpu))
goto out;
busiest = find_busiest_queue(this_rq, this_cpu, idle,
&imbalance, cpumask);
if (!busiest)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment