From: Mathieu Desnoyers Date: Tue, 8 May 2012 21:09:46 +0000 (-0400) Subject: rculfhash: Ensure future-proof memory barrier semantic consistency X-Git-Tag: v0.7.0~12 X-Git-Url: https://git.lttng.org/?p=urcu.git;a=commitdiff_plain;h=196f4fab9bf26c48bc318ac2ff985469c4f62c7e rculfhash: Ensure future-proof memory barrier semantic consistency Use cmm_smp_mb__before_uatomic_or() prior to the uatomic_or() in _rcu_lfht_del() to ensure correct memory barrier semantic when we relax (in the future) the barrier implementation of some architectures. Signed-off-by: Mathieu Desnoyers --- diff --git a/rculfhash.c b/rculfhash.c index e9cf062..3ad3618 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -1073,6 +1073,11 @@ int _cds_lfht_del(struct cds_lfht *ht, unsigned long size, if (caa_unlikely(is_removed(next))) return -ENOENT; assert(!is_bucket(next)); + /* + * The del operation semantic guarantees a full memory barrier + * before the uatomic_or atomic commit of the deletion flag. + */ + cmm_smp_mb__before_uatomic_or(); /* * We set the REMOVED_FLAG unconditionally. Note that there may * be more than one concurrent thread setting this flag.