lkml.org 
[lkml]   [2014]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 5/8] locking, mutex: Cancelable MCS lock for adaptive spinning
From
Date
On Wed, 2014-02-26 at 10:22 +0100, Peter Zijlstra wrote:
> On Tue, Feb 25, 2014 at 11:56:19AM -0800, Jason Low wrote:
> > On Mon, 2014-02-10 at 20:58 +0100, Peter Zijlstra wrote:
> > > + for (;;) {
> > > + if (prev->next == node &&
> > > + cmpxchg(&prev->next, node, NULL) == node)
> > > + break;
> > > +
> > > + /*
> > > + * We can only fail the cmpxchg() racing against an unlock(),
> > > + * in which case we should observe @node->locked becomming
> > > + * true.
> > > + */
> > > + if (smp_load_acquire(&node->locked))
> > > + return true;
>
> I've stuck on in right about here. So that we don't unduly delay the
> cmpxchg() after the load of prev.

Ok.

Reviewed-by: Jason Low <jason.low2@hp.com>




\
 
 \ /
  Last update: 2014-02-26 19:21    [W:0.079 / U:1.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site