Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1369562

Re: [PATCH] locking/qrwlock: Allow multiple spinning readers

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH] locking/qrwlock: Allow multiple spinning readers
Date 2016-04-01 22:00 +0200
Message-ID <rjdoB-Hb-1@gated-at.bofh.it> (permalink)
References (3 earlier) <rj4EG-2X4-13@gated-at.bofh.it> <rj4Om-326-5@gated-at.bofh.it> <rj4Y3-35K-45@gated-at.bofh.it> <rj5Kp-3FO-7@gated-at.bofh.it> <rjaqK-7af-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 ;-)

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] locking/qrwlock: Allow multiple spinning readers Waiman Long <Waiman.Long@hpe.com> - 2016-03-20 04:30 +0100
  Re: [PATCH] locking/qrwlock: Allow multiple spinning readers Peter Zijlstra <peterz@infradead.org> - 2016-03-20 11:50 +0100
    Re: [PATCH] locking/qrwlock: Allow multiple spinning readers Waiman Long <waiman.long@hpe.com> - 2016-03-22 03:30 +0100
  Re: [PATCH] locking/qrwlock: Allow multiple spinning readers Peter Zijlstra <peterz@infradead.org> - 2016-03-29 22:30 +0200
    Re: [PATCH] locking/qrwlock: Allow multiple spinning readers Waiman Long <waiman.long@hpe.com> - 2016-04-01 00:20 +0200
      Re: [PATCH] locking/qrwlock: Allow multiple spinning readers Peter Zijlstra <peterz@infradead.org> - 2016-04-01 12:30 +0200
      Re: [PATCH] locking/qrwlock: Allow multiple spinning readers Peter Zijlstra <peterz@infradead.org> - 2016-04-01 12:40 +0200
        Re: [PATCH] locking/qrwlock: Allow multiple spinning readers Will Deacon <will.deacon@arm.com> - 2016-04-01 12:50 +0200
          Re: [PATCH] locking/qrwlock: Allow multiple spinning readers Peter Zijlstra <peterz@infradead.org> - 2016-04-01 13:00 +0200
            Re: [PATCH] locking/qrwlock: Allow multiple spinning readers Peter Zijlstra <peterz@infradead.org> - 2016-04-01 13:50 +0200
              Re: [PATCH] locking/qrwlock: Allow multiple spinning readers Will Deacon <will.deacon@arm.com> - 2016-04-01 18:50 +0200
                Re: [PATCH] locking/qrwlock: Allow multiple spinning readers Peter Zijlstra <peterz@infradead.org> - 2016-04-01 22:00 +0200

csiph-web