lkml.org 
[lkml]   [2018]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2018-06-26 21:28    [W:0.151 / U:0.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site