Re: [RFC PATCH v3 7/9] yield_to(), cpu-hotplug: Prevent offliningof other CPUs properly

From: Oleg Nesterov
Date: Sun Dec 09 2012 - 14:48:44 EST


On 12/07, Srivatsa S. Bhat wrote:
>
> Once stop_machine() is gone from the CPU offline path, we won't be able to
> depend on local_irq_save() to prevent CPUs from going offline from under us.

OK, I guess we need to avoid resched_task()->smp_send_reschedule()
after __cpu_disable() and before migrate_tasks().

But, whatever problem we have,

> Use the get/put_online_cpus_atomic() APIs to prevent CPUs from going offline,
> while invoking from atomic context.

it should be solved, so...

> - if (preempt && rq != p_rq)
> + if (preempt && rq != p_rq && cpu_online(task_cpu(p)))

Why do we need this change?

Afaics, you could add BUG_ON(!cpu_online(...)) instead?

I am just curious.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/