Re: [PATCH 1/3] stop_machine: ensure that a queued callback will be called before cpu_stop_park()

2015-10-16 Thread Peter Zijlstra
On Thu, Oct 15, 2015 at 07:02:47PM +0200, Oleg Nesterov wrote: > Yes. IOW, this relies on ->selfparking == T which implies "flush before > park". Ah, we have a different reading of 'selfparking'. OK. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a

Re: [PATCH 1/3] stop_machine: ensure that a queued callback will be called before cpu_stop_park()

2015-10-16 Thread Peter Zijlstra
On Thu, Oct 15, 2015 at 07:02:47PM +0200, Oleg Nesterov wrote: > Yes. IOW, this relies on ->selfparking == T which implies "flush before > park". Ah, we have a different reading of 'selfparking'. OK. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a

Re: [PATCH 1/3] stop_machine: ensure that a queued callback will be called before cpu_stop_park()

2015-10-15 Thread Oleg Nesterov
On 10/14, Peter Zijlstra wrote: > > On Wed, Oct 14, 2015 at 09:03:56PM +0200, Oleg Nesterov wrote: > > On 10/14, Peter Zijlstra wrote: > > > > > > On Thu, Oct 08, 2015 at 04:51:31PM +0200, Oleg Nesterov wrote: > > > > > > > > Note also that smpboot_thread_call() calls cpu_stop_unpark() which > > >

Re: [PATCH 1/3] stop_machine: ensure that a queued callback will be called before cpu_stop_park()

2015-10-15 Thread Oleg Nesterov
On 10/14, Peter Zijlstra wrote: > > On Wed, Oct 14, 2015 at 09:03:56PM +0200, Oleg Nesterov wrote: > > On 10/14, Peter Zijlstra wrote: > > > > > > On Thu, Oct 08, 2015 at 04:51:31PM +0200, Oleg Nesterov wrote: > > > > > > > > Note also that smpboot_thread_call() calls cpu_stop_unpark() which > > >

Re: [PATCH 1/3] stop_machine: ensure that a queued callback will be called before cpu_stop_park()

2015-10-14 Thread Peter Zijlstra
On Wed, Oct 14, 2015 at 09:03:56PM +0200, Oleg Nesterov wrote: > On 10/14, Peter Zijlstra wrote: > > > > On Thu, Oct 08, 2015 at 04:51:31PM +0200, Oleg Nesterov wrote: > > > cpu_stop_queue_work() checks stopper->enabled before it queues the > > > work, but ->enabled == T can only guarantee

Re: [PATCH 1/3] stop_machine: ensure that a queued callback will be called before cpu_stop_park()

2015-10-14 Thread Oleg Nesterov
On 10/14, Peter Zijlstra wrote: > > On Thu, Oct 08, 2015 at 04:51:31PM +0200, Oleg Nesterov wrote: > > cpu_stop_queue_work() checks stopper->enabled before it queues the > > work, but ->enabled == T can only guarantee cpu_stop_signal_done() > > if we race with cpu_down(). > > > > This is not

Re: [PATCH 1/3] stop_machine: ensure that a queued callback will be called before cpu_stop_park()

2015-10-14 Thread Peter Zijlstra
On Thu, Oct 08, 2015 at 04:51:31PM +0200, Oleg Nesterov wrote: > cpu_stop_queue_work() checks stopper->enabled before it queues the > work, but ->enabled == T can only guarantee cpu_stop_signal_done() > if we race with cpu_down(). > > This is not enough for stop_two_cpus() or stop_machine(), they

Re: [PATCH 1/3] stop_machine: ensure that a queued callback will be called before cpu_stop_park()

2015-10-14 Thread Peter Zijlstra
On Thu, Oct 08, 2015 at 04:51:31PM +0200, Oleg Nesterov wrote: > cpu_stop_queue_work() checks stopper->enabled before it queues the > work, but ->enabled == T can only guarantee cpu_stop_signal_done() > if we race with cpu_down(). > > This is not enough for stop_two_cpus() or stop_machine(), they

Re: [PATCH 1/3] stop_machine: ensure that a queued callback will be called before cpu_stop_park()

2015-10-14 Thread Peter Zijlstra
On Wed, Oct 14, 2015 at 09:03:56PM +0200, Oleg Nesterov wrote: > On 10/14, Peter Zijlstra wrote: > > > > On Thu, Oct 08, 2015 at 04:51:31PM +0200, Oleg Nesterov wrote: > > > cpu_stop_queue_work() checks stopper->enabled before it queues the > > > work, but ->enabled == T can only guarantee

Re: [PATCH 1/3] stop_machine: ensure that a queued callback will be called before cpu_stop_park()

2015-10-14 Thread Oleg Nesterov
On 10/14, Peter Zijlstra wrote: > > On Thu, Oct 08, 2015 at 04:51:31PM +0200, Oleg Nesterov wrote: > > cpu_stop_queue_work() checks stopper->enabled before it queues the > > work, but ->enabled == T can only guarantee cpu_stop_signal_done() > > if we race with cpu_down(). > > > > This is not

[PATCH 1/3] stop_machine: ensure that a queued callback will be called before cpu_stop_park()

2015-10-08 Thread Oleg Nesterov
cpu_stop_queue_work() checks stopper->enabled before it queues the work, but ->enabled == T can only guarantee cpu_stop_signal_done() if we race with cpu_down(). This is not enough for stop_two_cpus() or stop_machine(), they will deadlock if multi_cpu_stop() won't be called by one of the target

[PATCH 1/3] stop_machine: ensure that a queued callback will be called before cpu_stop_park()

2015-10-08 Thread Oleg Nesterov
cpu_stop_queue_work() checks stopper->enabled before it queues the work, but ->enabled == T can only guarantee cpu_stop_signal_done() if we race with cpu_down(). This is not enough for stop_two_cpus() or stop_machine(), they will deadlock if multi_cpu_stop() won't be called by one of the target