[lttng-dev] [PATCH v2 05/12] urcu/uatomic: Add CMM memory model

Paul E. McKenney paulmck at kernel.org
Thu Jun 29 14:40:08 EDT 2023


On Thu, Jun 29, 2023 at 12:49:00PM -0400, Olivier Dion wrote:
> On Wed, 21 Jun 2023, "Paul E. McKenney" <paulmck at kernel.org> wrote:
> > On Wed, Jun 07, 2023 at 02:53:52PM -0400, Olivier Dion wrote:
> >> -#ifdef __URCU_DEREFERENCE_USE_ATOMIC_CONSUME
> >> -# define _rcu_dereference(p) __extension__ ({						\
> >> -				__typeof__(__extension__ ({				\
> >> -					__typeof__(p) __attribute__((unused)) _________p0 = { 0 }; \
> >> -					_________p0;					\
> >> -				})) _________p1;					\
> >> -				__atomic_load(&(p), &_________p1, __ATOMIC_CONSUME);	\
> >
> > There is talk of getting rid of memory_order_consume.  But for the moment,
> > it is what there is.  Another alternative is to use a volatile load,
> > similar to old-style CMM_LOAD_SHARED() or in-kernel READ_ONCE().
> 
> I think we can stick to __ATOMIC_CONSUME for now.  Hopefully getting rid
> of it means it will be an alias for __ATOMIC_ACQUIRE for ever.

That seems emininently reasonable to me!

							Thanx, Paul


More information about the lttng-dev mailing list