lkml.org 
[lkml]   [2015]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:locking/core] locking/pvqspinlock: Replace xchg() by the more descriptive set_mb()
On Tue, May 12, 2015 at 10:45:29AM +0200, Peter Zijlstra wrote:
> On Mon, May 11, 2015 at 10:50:42AM -0700, Linus Torvalds wrote:
> > On Mon, May 11, 2015 at 7:54 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> > >
> > > Hmm, so I looked at the set_mb() definitions and I figure we want to do
> > > something like the below, right?
> >
> > I don't think you need to do this for the non-smp cases.
>
> Well, its the store tearing thing again, we use WRITE_ONCE() in
> smp_store_release() for the same reason. We want it to be a single
> store.
>
> > The whole
> > thing is about smp memory ordering, so on UP you don't even need the
> > WRITE_ONCE(), much less a barrier.

Ah, you meant the memory barrier; indeed, a compiler barrier is
sufficient. I got somewhat confused between Waiman's email and barrier
and barrier() (again!).




\
 
 \ /
  Last update: 2015-05-12 15:41    [W:0.044 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site