Re: [PATCH 3/3] early_printk: Add simple serialization to early_vprintk()
From: Peter Zijlstra
Date: Wed Oct 04 2017 - 09:09:08 EST
On Wed, Oct 04, 2017 at 09:04:01AM -0400, Steven Rostedt wrote:
> > > If old != -1 and old != cpu, is it possible that the CPU could have
> > > fetched an old value, and never try to fetch it again?
> >
> > What? If old != -1 and old != cpu, we'll hit the cpu_relax() and do the
> > READ_ONCE() again. The READ_ONCE() guarantees we'll do the load again,
> > as does the barrier() implied by cpu_relax().
>
> I'm more worried about other architectures that don't have as strong of
> a cache coherency.
Linux mandates cache-coherency, there's no weak or strong there. Memory
ordering can be weak or strong, but coherency not.
If this patch is broken, lots of code would be broken.