From: Mathieu Desnoyers Date: Tue, 29 Sep 2009 03:34:52 +0000 (-0400) Subject: Align registry data on cache line size X-Git-Tag: v0.1~6 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=bd1a5e15ab6d3e42be1af622bbc53a30f5ae3769;p=urcu.git Align registry data on cache line size Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu-qsbr-static.h b/urcu-qsbr-static.h index 1cac56c..8735c7f 100644 --- a/urcu-qsbr-static.h +++ b/urcu-qsbr-static.h @@ -184,8 +184,10 @@ static inline void reader_barrier() extern unsigned long urcu_gp_ctr; struct urcu_reader { + /* Data used by both reader and synchronize_rcu() */ unsigned long ctr; - struct list_head head; + /* Data used for registry */ + struct list_head head __attribute__((aligned(CACHE_LINE_SIZE))); pthread_t tid; }; diff --git a/urcu-static.h b/urcu-static.h index f2a463c..3b7ea32 100644 --- a/urcu-static.h +++ b/urcu-static.h @@ -220,10 +220,12 @@ static inline void reader_barrier() extern long urcu_gp_ctr; struct urcu_reader { + /* Data used by both reader and synchronize_rcu() */ long ctr; - struct list_head head; - pthread_t tid; char need_mb; + /* Data used for registry */ + struct list_head head __attribute__((aligned(CACHE_LINE_SIZE))); + pthread_t tid; }; extern struct urcu_reader __thread urcu_reader;