Align registry data on cache line size
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Tue, 29 Sep 2009 03:34:52 +0000 (23:34 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Tue, 29 Sep 2009 03:34:52 +0000 (23:34 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
urcu-qsbr-static.h
urcu-static.h

index 1cac56cb8a561ae509f1f4722a7c94504b914b48..8735c7fd3fe081f36e86af5cc6292e827ff8802b 100644 (file)
@@ -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;
 };
 
index f2a463c47ab9dd03eff61c84d90c6c0d5edf6f3b..3b7ea3217bb58029e06f2e4ac67be6aad648e9c6 100644 (file)
@@ -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;
This page took 0.024867 seconds and 4 git commands to generate.