Re: [PATCH 11/18] seqcount: Introduce raw_write_seqcount_barrier()

Peter Zijlstra
2015-06-12T07:08:39Z

On Thu, Jun 11, 2015 at 02:45:57PM -0700, Paul E. McKenney wrote:
> Color me slow and stupid. Maybe due to reviewing a patch too early in
> the morning, who knows?
>
> There is nothing above that prevents the compiler and the CPU from
> reordering the assignments to X and Y with the increment of s->sequence++.

That's actually fine. As long as we observe an odd value the read side
will repeat.

> Of course, this assumes that the accesses surrounding the call to
> raw_write_seqcount_barrier() are writes.

Which is why its got both write and barrier in the name :-)