Re: [RFC PATCH v3 01/16] stop_machine: Fix stop_cpus_in_progress ordering

From: Peter Zijlstra
Date: Mon Aug 26 2019 - 12:59:59 EST


On Mon, Aug 26, 2019 at 09:19:31AM -0700, mark gross wrote:
> On Wed, May 29, 2019 at 08:36:37PM +0000, Vineeth Remanan Pillai wrote:
> > From: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> >
> > Make sure the entire for loop has stop_cpus_in_progress set.
> It is not clear how this commit comment matches the change. Please explain
> how adding 2 barrier's makes sure stop_cpus_in_progress is set for the entier
> for loop.

Without the barrier the compiler is free to move the stores around. It
probably doesn't do anything bad, but this makes sure it cannot.