[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180626192728.GN2494@hirez.programming.kicks-ass.net>
Date: Tue, 26 Jun 2018 21:27:28 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc: linux-kernel@...r.kernel.org, mingo@...nel.org,
jiangshanlai@...il.com, dipankar@...ibm.com,
akpm@...ux-foundation.org, mathieu.desnoyers@...icios.com,
josh@...htriplett.org, tglx@...utronix.de, rostedt@...dmis.org,
dhowells@...hat.com, edumazet@...gle.com, fweisbec@...il.com,
oleg@...hat.com, joel@...lfernandes.org
Subject: Re: [PATCH tip/core/rcu 16/27] rcu: Add comment documenting how
rcu_seq_snap works
On Tue, Jun 26, 2018 at 11:10:25AM -0700, Paul E. McKenney wrote:
> > Is the below not much simpler:
> >
> > > static inline unsigned long rcu_seq_snap(unsigned long *sp)
> > > {
> > > unsigned long s;
> >
> > s = smp_load_aquire(sp);
> >
> > /* Add one GP */
> > s += 1 << RCU_SEQ_CTR_SHIFT;
> >
> > /* Complete any pending state by rounding up */
> > s = __ALIGN_MASK(s, RCU_SEQ_STATE_MASK);
> >
> > return s;
> > }
>
> Seems equivalent to me, but with more lines. To say nothing of more
> levels of lookup of macro definitions. ;-)
But it does explain the various parts in the equation, or at least gives
a fair clue as to how the thing composes. And I find the alignment thing
far easier to read that an open coded variant, but whatever.
Powered by blists - more mailing lists