Re: [PATCH] stop_machine: Remove cpu swap from stop_two_cpus

2018-06-28 Thread Pavan Kondeti
On Tue, Jun 26, 2018 at 02:28:26PM -0700, Isaac J. Manjarres wrote: > When invoking migrate_swap(), stop_two_cpus() swaps the > source and destination CPU IDs if the destination CPU > ID is greater than the source CPU ID. This leads to the > following race condition: > > The source CPU invokes

Re: [PATCH] stop_machine: Remove cpu swap from stop_two_cpus

2018-06-28 Thread Pavan Kondeti
On Tue, Jun 26, 2018 at 02:28:26PM -0700, Isaac J. Manjarres wrote: > When invoking migrate_swap(), stop_two_cpus() swaps the > source and destination CPU IDs if the destination CPU > ID is greater than the source CPU ID. This leads to the > following race condition: > > The source CPU invokes

Re: [PATCH] stop_machine: Remove cpu swap from stop_two_cpus

2018-06-27 Thread Sodagudi Prasad
On 2018-06-27 00:15, Sebastian Andrzej Siewior wrote: On 2018-06-26 14:28:26 [-0700], Isaac J. Manjarres wrote: Remove CPU ID swapping in stop_two_cpus() so that the source CPU's stopper thread is added to the wake queue last, so that the source CPU's stopper thread is woken up last, ensuring

Re: [PATCH] stop_machine: Remove cpu swap from stop_two_cpus

2018-06-27 Thread Sodagudi Prasad
On 2018-06-27 00:15, Sebastian Andrzej Siewior wrote: On 2018-06-26 14:28:26 [-0700], Isaac J. Manjarres wrote: Remove CPU ID swapping in stop_two_cpus() so that the source CPU's stopper thread is added to the wake queue last, so that the source CPU's stopper thread is woken up last, ensuring

Re: [PATCH] stop_machine: Remove cpu swap from stop_two_cpus

2018-06-27 Thread Sebastian Andrzej Siewior
On 2018-06-26 14:28:26 [-0700], Isaac J. Manjarres wrote: > Remove CPU ID swapping in stop_two_cpus() so that the > source CPU's stopper thread is added to the wake queue last, > so that the source CPU's stopper thread is woken up last, > ensuring that all other threads that it depends on are

Re: [PATCH] stop_machine: Remove cpu swap from stop_two_cpus

2018-06-27 Thread Sebastian Andrzej Siewior
On 2018-06-26 14:28:26 [-0700], Isaac J. Manjarres wrote: > Remove CPU ID swapping in stop_two_cpus() so that the > source CPU's stopper thread is added to the wake queue last, > so that the source CPU's stopper thread is woken up last, > ensuring that all other threads that it depends on are

[PATCH] stop_machine: Remove cpu swap from stop_two_cpus

2018-06-26 Thread Isaac J. Manjarres
When invoking migrate_swap(), stop_two_cpus() swaps the source and destination CPU IDs if the destination CPU ID is greater than the source CPU ID. This leads to the following race condition: The source CPU invokes migrate_swap and sets itself as the source CPU, and sets the destination CPU to

[PATCH] stop_machine: Remove cpu swap from stop_two_cpus

2018-06-26 Thread Isaac J. Manjarres
When invoking migrate_swap(), stop_two_cpus() swaps the source and destination CPU IDs if the destination CPU ID is greater than the source CPU ID. This leads to the following race condition: The source CPU invokes migrate_swap and sets itself as the source CPU, and sets the destination CPU to