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

2012-12-09 Thread Srivatsa S. Bhat
On 12/10/2012 02:10 AM, Oleg Nesterov wrote: > On 12/10, Srivatsa S. Bhat wrote: >> >> On 12/10/2012 01:18 AM, Oleg Nesterov wrote: - if (preempt && rq != p_rq) + if (preempt && rq != p_rq && cpu_online(task_cpu(p))) >>> >>> Why do we need this change? >>> >>> Afaics,

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

2012-12-09 Thread Oleg Nesterov
On 12/10, Srivatsa S. Bhat wrote: > > On 12/10/2012 01:18 AM, Oleg Nesterov wrote: > >> - 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? >

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

2012-12-09 Thread Srivatsa S. Bhat
On 12/10/2012 01:18 AM, Oleg Nesterov wrote: > 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

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

2012-12-09 Thread Oleg Nesterov
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

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

2012-12-09 Thread Oleg Nesterov
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

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

2012-12-09 Thread Srivatsa S. Bhat
On 12/10/2012 01:18 AM, Oleg Nesterov wrote: 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

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

2012-12-09 Thread Oleg Nesterov
On 12/10, Srivatsa S. Bhat wrote: On 12/10/2012 01:18 AM, Oleg Nesterov wrote: - 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.

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

2012-12-09 Thread Srivatsa S. Bhat
On 12/10/2012 02:10 AM, Oleg Nesterov wrote: On 12/10, Srivatsa S. Bhat wrote: On 12/10/2012 01:18 AM, Oleg Nesterov wrote: - 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

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

2012-12-07 Thread Srivatsa S. Bhat
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. Use the get/put_online_cpus_atomic() APIs to prevent CPUs from going offline, while invoking from atomic context. Signed-off-by: Srivatsa S.

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

2012-12-07 Thread Srivatsa S. Bhat
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. Use the get/put_online_cpus_atomic() APIs to prevent CPUs from going offline, while invoking from atomic context. Signed-off-by: Srivatsa S.