Re: [lttng-dev] [PATCH 04/11] urcu/arch/generic: Use atomic builtins if configured
"Paul E. McKenney via lttng-dev" <[email protected]>
| Newsgroups | org.lttng.lists.lttng-dev |
|---|---|
| Message-ID | <bc031f8e-8380-4a1d-bfe2-9e8204e06283@paulmck-laptop> |
On Mon, May 15, 2023 at 04:17:11PM -0400, Olivier Dion wrote: > If configured to use atomic builtins, implement SMP memory barriers in > term of atomic builtins if the architecture does not implement its own > version. > > Change-Id: Iddc4283606e0fce572e104d2d3f03b5c0d9926fb > Co-authored-by: Mathieu Desnoyers <[email protected]> > Signed-off-by: Olivier Dion <[email protected]> > --- > include/urcu/arch/generic.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/include/urcu/arch/generic.h b/include/urcu/arch/generic.h > index be6e41e..e292c70 100644 > --- a/include/urcu/arch/generic.h > +++ b/include/urcu/arch/generic.h > @@ -43,6 +43,14 @@ extern "C" { > * GCC builtins) as well as cmm_rmb and cmm_wmb (defaulting to cmm_mb). > */ > > +#ifdef CONFIG_RCU_USE_ATOMIC_BUILTINS > + > +# ifndef cmm_smp_mb > +# define cmm_smp_mb() __atomic_thread_fence(__ATOMIC_SEQ_CST) > +# endif > + > +#endif /* CONFIG_RCU_USE_ATOMIC_BUILTINS */ > + > #ifndef cmm_mb > #define cmm_mb() __sync_synchronize() Just out of curiosity, why not also implement cmm_mb() in terms of __atomic_thread_fence(__ATOMIC_SEQ_CST)? (Or is that a later patch?) Thanx, Paul > #endif > -- > 2.39.2 > _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev