lkml.org 
[lkml]   [2016]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] locking/qrwlock: Allow multiple spinning readers
On Fri, Apr 01, 2016 at 05:47:43PM +0100, Will Deacon wrote:
> > +#define smp_cond_load_acquire(ptr, cond_expr) ({ \
> > + typeof(ptr) __PTR = (ptr); \
> > + typeof(*ptr) VAL; \
>
> It's a bit grim having a magic variable name, but I have no better
> suggestion.

Right; we had this discussion and this is the best we could come up
with.

lkml.kernel.org/r/CA+55aFzZA9EB3hFptSpdmeMOifeM5BWQGOW+ib7SLvyMTETzaA@mail.gmail.com

> > + for (;;) { \
> > + VAL = READ_ONCE(*__PTR); \
> > + if (cond_expr) \
> > + break; \
> > + cpu_relax(); \
> > + } \
> > + smp_rmb(); /* ctrl + rmb := acquire */ \
> > + VAL; \
> > +})
>
> Can you stick some #ifndef guards around this, please?

Oh sure; I'll even compile and boot it when I find a moment ;-)

\
 
 \ /
  Last update: 2016-04-01 22:41    [W:0.063 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site