Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [ltt-dev] [URCU PATCH 1/3] Rename all memory primitives with prefix cmm_
@ 2010-11-18 20:31 David Goulet
  2010-11-18 20:31 ` [ltt-dev] [URCU PATCH 2/3] Rename all arch primitives with prefix caa_ David Goulet
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Goulet @ 2010-11-18 20:31 UTC (permalink / raw)


In order to not pollute the userspace namespace for application
using liburcu or any lib/apps linked with urcu, this patch if the
first of three major refactor for naming convention.

The cmm_ prefix is a short name for Concurrent Memory Model and was
suggested by Mathieu Desnoyers and Paul E. Mckenney. Every memory
primitives such as mb, wmb, rmb, and so on are renamed.

Signed-off-by: David Goulet <david.goulet at polymtl.ca>
---
 compat_futex.c             |    4 +-
 tests/api_gcc.h            |    8 ++--
 tests/api_ppc.h            |    8 ++--
 tests/api_x86.h            |    8 ++--
 tests/rcutorture.h         |   18 ++++----
 tests/test_mutex.c         |    6 +-
 tests/test_perthreadlock.c |    6 +-
 tests/test_qsbr.c          |    6 +-
 tests/test_qsbr_gc.c       |    6 +-
 tests/test_rwlock.c        |    6 +-
 tests/test_urcu.c          |    6 +-
 tests/test_urcu_assign.c   |    6 +-
 tests/test_urcu_bp.c       |    6 +-
 tests/test_urcu_defer.c    |    6 +-
 tests/test_urcu_gc.c       |    6 +-
 tests/test_urcu_lfq.c      |    6 +-
 tests/test_urcu_lfs.c      |    6 +-
 tests/test_urcu_wfq.c      |    6 +-
 tests/test_urcu_wfs.c      |    6 +-
 urcu-bp-static.h           |    8 ++--
 urcu-bp.c                  |   16 ++++----
 urcu-defer.c               |   14 +++---
 urcu-pointer-static.h      |    8 ++--
 urcu-pointer.c             |    6 +-
 urcu-qsbr-static.h         |   16 ++++----
 urcu-qsbr.c                |   28 ++++++------
 urcu-static.h              |   12 +++---
 urcu.c                     |   36 ++++++++--------
 urcu/arch_alpha.h          |    6 +-
 urcu/arch_armv7l.h         |    2 +-
 urcu/arch_generic.h        |   98 ++++++++++++++++++++++----------------------
 urcu/arch_ppc.h            |    6 +-
 urcu/arch_s390.h           |    2 +-
 urcu/arch_sparc64.h        |    6 +-
 urcu/arch_x86.h            |   14 +++---
 urcu/compiler.h            |    2 +-
 urcu/rcuhlist.h            |    2 +-
 urcu/rculist.h             |    2 +-
 urcu/system.h              |    8 ++--
 39 files changed, 211 insertions(+), 211 deletions(-)

diff --git a/compat_futex.c b/compat_futex.c
index 61bc6c3..9dfcfeb 100644
--- a/compat_futex.c
+++ b/compat_futex.c
@@ -55,7 +55,7 @@ int compat_futex_noasync(int *uaddr, int op, int val,
 	/*
 	 * memory barriers to serialize with the previous uaddr modification.
 	 */
-	smp_mb();
+	cmm_smp_mb();
 
 	ret = pthread_mutex_lock(&compat_futex_lock);
 	assert(!ret);
@@ -100,7 +100,7 @@ int compat_futex_async(int *uaddr, int op, int val,
 	/*
 	 * Ensure previous memory operations on uaddr have completed.
 	 */
-	smp_mb();
+	cmm_smp_mb();
 
 	switch (op) {
 	case FUTEX_WAIT:
diff --git a/tests/api_gcc.h b/tests/api_gcc.h
index be437cc..b23110d 100644
--- a/tests/api_gcc.h
+++ b/tests/api_gcc.h
@@ -251,10 +251,10 @@ cmpxchg(volatile long *ptr, long oldval, long newval)
 #define atomic_dec_return(v)  (atomic_sub_return(1,v))
 
 /* Atomic operations are already serializing on x86 */
-#define smp_mb__before_atomic_dec()	barrier()
-#define smp_mb__after_atomic_dec()	barrier()
-#define smp_mb__before_atomic_inc()	barrier()
-#define smp_mb__after_atomic_inc()	barrier()
+#define smp_mb__before_atomic_dec()	cmm_barrier()
+#define smp_mb__after_atomic_dec()	cmm_barrier()
+#define smp_mb__before_atomic_inc()	cmm_barrier()
+#define smp_mb__after_atomic_inc()	cmm_barrier()
 
 #endif //0 /* duplicate with arch_atomic.h */
 
diff --git a/tests/api_ppc.h b/tests/api_ppc.h
index 6548077..9773500 100644
--- a/tests/api_ppc.h
+++ b/tests/api_ppc.h
@@ -616,10 +616,10 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
 #define atomic_dec_return(v)  (atomic_sub_return(1,v))
 
 /* Atomic operations are already serializing on x86 */
-#define smp_mb__before_atomic_dec()	smp_mb()
-#define smp_mb__after_atomic_dec()	smp_mb()
-#define smp_mb__before_atomic_inc()	smp_mb()
-#define smp_mb__after_atomic_inc()	smp_mb()
+#define smp_mb__before_atomic_dec()	cmm_smp_mb()
+#define smp_mb__after_atomic_dec()	cmm_smp_mb()
+#define smp_mb__before_atomic_inc()	cmm_smp_mb()
+#define smp_mb__after_atomic_inc()	cmm_smp_mb()
 
 #endif //0 /* duplicate with arch_atomic.h */
 
diff --git a/tests/api_x86.h b/tests/api_x86.h
index cdd4667..fe00a35 100644
--- a/tests/api_x86.h
+++ b/tests/api_x86.h
@@ -312,10 +312,10 @@ __asm__ __volatile__(LOCK_PREFIX "orl %0,%1" \
 : : "r" (mask),"m" (*(addr)) : "memory")
 
 /* Atomic operations are already serializing on x86 */
-#define smp_mb__before_atomic_dec()	barrier()
-#define smp_mb__after_atomic_dec()	barrier()
-#define smp_mb__before_atomic_inc()	barrier()
-#define smp_mb__after_atomic_inc()	barrier()
+#define smp_mb__before_atomic_dec()	cmm_barrier()
+#define smp_mb__after_atomic_dec()	cmm_barrier()
+#define smp_mb__before_atomic_inc()	cmm_barrier()
+#define smp_mb__after_atomic_inc()	cmm_barrier()
 
 #endif //0
 
diff --git a/tests/rcutorture.h b/tests/rcutorture.h
index 181547a..4192bd0 100644
--- a/tests/rcutorture.h
+++ b/tests/rcutorture.h
@@ -170,15 +170,15 @@ void perftestrun(int nthreads, int nreaders, int nupdaters)
 	int t;
 	int duration = 1;
 
-	smp_mb();
+	cmm_smp_mb();
 	while (uatomic_read(&nthreadsrunning) < nthreads)
 		poll(NULL, 0, 1);
 	goflag = GOFLAG_RUN;
-	smp_mb();
+	cmm_smp_mb();
 	sleep(duration);
-	smp_mb();
+	cmm_smp_mb();
 	goflag = GOFLAG_STOP;
-	smp_mb();
+	cmm_smp_mb();
 	wait_all_threads();
 	for_each_thread(t) {
 		n_reads += per_thread(n_reads_pt, t);
@@ -309,7 +309,7 @@ void *rcu_update_stress_test(void *arg)
 			i = 0;
 		p = &rcu_stress_array[i];
 		p->mbtest = 0;
-		smp_mb();
+		cmm_smp_mb();
 		p->pipe_count = 0;
 		p->mbtest = 1;
 		rcu_assign_pointer(rcu_stress_current, p);
@@ -355,13 +355,13 @@ void stresstest(int nreaders)
 	create_thread(rcu_update_stress_test, NULL);
 	for (i = 0; i < 5; i++)
 		create_thread(rcu_fake_update_stress_test, NULL);
-	smp_mb();
+	cmm_smp_mb();
 	goflag = GOFLAG_RUN;
-	smp_mb();
+	cmm_smp_mb();
 	sleep(10);
-	smp_mb();
+	cmm_smp_mb();
 	goflag = GOFLAG_STOP;
-	smp_mb();
+	cmm_smp_mb();
 	wait_all_threads();
 	for_each_thread(t)
 		n_reads += per_thread(n_reads_pt, t);
diff --git a/tests/test_mutex.c b/tests/test_mutex.c
index 7b2d1a5..7dd1e31 100644
--- a/tests/test_mutex.c
+++ b/tests/test_mutex.c
@@ -229,7 +229,7 @@ void *thr_writer(void *data)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		pthread_mutex_lock(&lock);
@@ -278,7 +278,7 @@ int main(int argc, char **argv)
 		show_usage(argc, argv);
 		return -1;
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	err = sscanf(argv[1], "%u", &nr_readers);
 	if (err != 1) {
@@ -376,7 +376,7 @@ int main(int argc, char **argv)
 			exit(1);
 	}
 
-	smp_mb();
+	cmm_smp_mb();
 
 	test_go = 1;
 
diff --git a/tests/test_perthreadlock.c b/tests/test_perthreadlock.c
index 7862f62..9de8ced 100644
--- a/tests/test_perthreadlock.c
+++ b/tests/test_perthreadlock.c
@@ -234,7 +234,7 @@ void *thr_writer(void *data)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		for (tidx = 0; tidx < nr_readers; tidx++) {
@@ -287,7 +287,7 @@ int main(int argc, char **argv)
 		show_usage(argc, argv);
 		return -1;
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	err = sscanf(argv[1], "%u", &nr_readers);
 	if (err != 1) {
@@ -386,7 +386,7 @@ int main(int argc, char **argv)
 			exit(1);
 	}
 
-	smp_mb();
+	cmm_smp_mb();
 
 	test_go = 1;
 
diff --git a/tests/test_qsbr.c b/tests/test_qsbr.c
index 0101907..4f19c72 100644
--- a/tests/test_qsbr.c
+++ b/tests/test_qsbr.c
@@ -230,7 +230,7 @@ void *thr_reader(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		rcu_read_lock();
@@ -275,7 +275,7 @@ void *thr_writer(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		new = test_array_alloc();
@@ -424,7 +424,7 @@ int main(int argc, char **argv)
 			exit(1);
 	}
 
-	smp_mb();
+	cmm_smp_mb();
 
 	test_go = 1;
 
diff --git a/tests/test_qsbr_gc.c b/tests/test_qsbr_gc.c
index 2b4fa7a..875fd36 100644
--- a/tests/test_qsbr_gc.c
+++ b/tests/test_qsbr_gc.c
@@ -203,7 +203,7 @@ void *thr_reader(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		_rcu_read_lock();
@@ -279,7 +279,7 @@ void *thr_writer(void *data)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 #ifndef TEST_LOCAL_GC
@@ -444,7 +444,7 @@ int main(int argc, char **argv)
 			exit(1);
 	}
 
-	smp_mb();
+	cmm_smp_mb();
 
 	test_go = 1;
 
diff --git a/tests/test_rwlock.c b/tests/test_rwlock.c
index 1c65fca..445ce95 100644
--- a/tests/test_rwlock.c
+++ b/tests/test_rwlock.c
@@ -225,7 +225,7 @@ void *thr_writer(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		pthread_rwlock_wrlock(&lock);
@@ -274,7 +274,7 @@ int main(int argc, char **argv)
 		show_usage(argc, argv);
 		return -1;
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	err = sscanf(argv[1], "%u", &nr_readers);
 	if (err != 1) {
@@ -370,7 +370,7 @@ int main(int argc, char **argv)
 			exit(1);
 	}
 
-	smp_mb();
+	cmm_smp_mb();
 
 	test_go = 1;
 
diff --git a/tests/test_urcu.c b/tests/test_urcu.c
index 5096415..eeea7f5 100644
--- a/tests/test_urcu.c
+++ b/tests/test_urcu.c
@@ -231,7 +231,7 @@ void *thr_reader(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		rcu_read_lock();
@@ -273,7 +273,7 @@ void *thr_writer(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		new = test_array_alloc();
@@ -421,7 +421,7 @@ int main(int argc, char **argv)
 			exit(1);
 	}
 
-	smp_mb();
+	cmm_smp_mb();
 
 	test_go = 1;
 
diff --git a/tests/test_urcu_assign.c b/tests/test_urcu_assign.c
index b1298a4..481cdd6 100644
--- a/tests/test_urcu_assign.c
+++ b/tests/test_urcu_assign.c
@@ -231,7 +231,7 @@ void *thr_reader(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		rcu_read_lock();
@@ -269,7 +269,7 @@ void *thr_writer(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		new = test_array_alloc();
@@ -420,7 +420,7 @@ int main(int argc, char **argv)
 			exit(1);
 	}
 
-	smp_mb();
+	cmm_smp_mb();
 
 	test_go = 1;
 
diff --git a/tests/test_urcu_bp.c b/tests/test_urcu_bp.c
index 239e843..e831824 100644
--- a/tests/test_urcu_bp.c
+++ b/tests/test_urcu_bp.c
@@ -231,7 +231,7 @@ void *thr_reader(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		rcu_read_lock();
@@ -269,7 +269,7 @@ void *thr_writer(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		new = test_array_alloc();
@@ -417,7 +417,7 @@ int main(int argc, char **argv)
 			exit(1);
 	}
 
-	smp_mb();
+	cmm_smp_mb();
 
 	test_go = 1;
 
diff --git a/tests/test_urcu_defer.c b/tests/test_urcu_defer.c
index 6fae313..2cbb041 100644
--- a/tests/test_urcu_defer.c
+++ b/tests/test_urcu_defer.c
@@ -199,7 +199,7 @@ void *thr_reader(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		rcu_read_lock();
@@ -247,7 +247,7 @@ void *thr_writer(void *data)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		new = malloc(sizeof(*new));
@@ -400,7 +400,7 @@ int main(int argc, char **argv)
 			exit(1);
 	}
 
-	smp_mb();
+	cmm_smp_mb();
 
 	test_go = 1;
 
diff --git a/tests/test_urcu_gc.c b/tests/test_urcu_gc.c
index 2c944a5..ddafb87 100644
--- a/tests/test_urcu_gc.c
+++ b/tests/test_urcu_gc.c
@@ -207,7 +207,7 @@ void *thr_reader(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		rcu_read_lock();
@@ -280,7 +280,7 @@ void *thr_writer(void *data)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 #ifndef TEST_LOCAL_GC
@@ -444,7 +444,7 @@ int main(int argc, char **argv)
 			exit(1);
 	}
 
-	smp_mb();
+	cmm_smp_mb();
 
 	test_go = 1;
 
diff --git a/tests/test_urcu_lfq.c b/tests/test_urcu_lfq.c
index 87c53b6..901bcae 100644
--- a/tests/test_urcu_lfq.c
+++ b/tests/test_urcu_lfq.c
@@ -170,7 +170,7 @@ void *thr_enqueuer(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		struct rcu_lfq_node *node = malloc(sizeof(*node));
@@ -223,7 +223,7 @@ void *thr_dequeuer(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		struct rcu_lfq_node *node = rcu_lfq_dequeue(&q,
@@ -380,7 +380,7 @@ int main(int argc, char **argv)
 			exit(1);
 	}
 
-	smp_mb();
+	cmm_smp_mb();
 
 	test_go = 1;
 
diff --git a/tests/test_urcu_lfs.c b/tests/test_urcu_lfs.c
index 8f881e7..8249eba 100644
--- a/tests/test_urcu_lfs.c
+++ b/tests/test_urcu_lfs.c
@@ -170,7 +170,7 @@ void *thr_enqueuer(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		struct rcu_lfs_node *node = malloc(sizeof(*node));
@@ -215,7 +215,7 @@ void *thr_dequeuer(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		struct rcu_lfs_node *node = rcu_lfs_pop(&s);
@@ -365,7 +365,7 @@ int main(int argc, char **argv)
 			exit(1);
 	}
 
-	smp_mb();
+	cmm_smp_mb();
 
 	test_go = 1;
 
diff --git a/tests/test_urcu_wfq.c b/tests/test_urcu_wfq.c
index b0629d2..d446e47 100644
--- a/tests/test_urcu_wfq.c
+++ b/tests/test_urcu_wfq.c
@@ -167,7 +167,7 @@ void *thr_enqueuer(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		struct wfq_node *node = malloc(sizeof(*node));
@@ -207,7 +207,7 @@ void *thr_dequeuer(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		struct wfq_node *node = wfq_dequeue_blocking(&q);
@@ -354,7 +354,7 @@ int main(int argc, char **argv)
 			exit(1);
 	}
 
-	smp_mb();
+	cmm_smp_mb();
 
 	test_go = 1;
 
diff --git a/tests/test_urcu_wfs.c b/tests/test_urcu_wfs.c
index f50b140..294e955 100644
--- a/tests/test_urcu_wfs.c
+++ b/tests/test_urcu_wfs.c
@@ -167,7 +167,7 @@ void *thr_enqueuer(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		struct wfs_node *node = malloc(sizeof(*node));
@@ -207,7 +207,7 @@ void *thr_dequeuer(void *_count)
 	while (!test_go)
 	{
 	}
-	smp_mb();
+	cmm_smp_mb();
 
 	for (;;) {
 		struct wfs_node *node = wfs_pop_blocking(&s);
@@ -354,7 +354,7 @@ int main(int argc, char **argv)
 			exit(1);
 	}
 
-	smp_mb();
+	cmm_smp_mb();
 
 	test_go = 1;
 
diff --git a/urcu-bp-static.h b/urcu-bp-static.h
index 6d7e3c8..394476b 100644
--- a/urcu-bp-static.h
+++ b/urcu-bp-static.h
@@ -175,7 +175,7 @@ static inline void _rcu_read_lock(void)
 	if (unlikely(!rcu_reader))
 		rcu_bp_register();
 
-	barrier();	/* Ensure the compiler does not reorder us with mutex */
+	cmm_barrier();	/* Ensure the compiler does not reorder us with mutex */
 	tmp = rcu_reader->ctr;
 	/*
 	 * rcu_gp_ctr is
@@ -187,7 +187,7 @@ static inline void _rcu_read_lock(void)
 		 * Set active readers count for outermost nesting level before
 		 * accessing the pointer.
 		 */
-		smp_mb();
+		cmm_smp_mb();
 	} else {
 		_STORE_SHARED(rcu_reader->ctr, tmp + RCU_GP_COUNT);
 	}
@@ -198,9 +198,9 @@ static inline void _rcu_read_unlock(void)
 	/*
 	 * Finish using rcu before decrementing the pointer.
 	 */
-	smp_mb();
+	cmm_smp_mb();
 	_STORE_SHARED(rcu_reader->ctr, rcu_reader->ctr - RCU_GP_COUNT);
-	barrier();	/* Ensure the compiler does not reorder us with mutex */
+	cmm_barrier();	/* Ensure the compiler does not reorder us with mutex */
 }
 
 #ifdef __cplusplus 
diff --git a/urcu-bp.c b/urcu-bp.c
index 61d42fa..33352c2 100644
--- a/urcu-bp.c
+++ b/urcu-bp.c
@@ -96,9 +96,9 @@ static void mutex_lock(pthread_mutex_t *mutex)
 			exit(-1);
 		}
 		if (rcu_reader.need_mb) {
-			smp_mb();
+			cmm_smp_mb();
 			rcu_reader.need_mb = 0;
-			smp_mb();
+			cmm_smp_mb();
 		}
 		poll(NULL,0,10);
 	}
@@ -133,11 +133,11 @@ void update_counter_and_wait(void)
 	 */
 
 	/*
-	 * Adding a smp_mb() which is _not_ formally required, but makes the
+	 * Adding a cmm_smp_mb() which is _not_ formally required, but makes the
 	 * model easier to understand. It does not have a big performance impact
 	 * anyway, given this is the write-side.
 	 */
-	smp_mb();
+	cmm_smp_mb();
 
 	/*
 	 * Wait for each thread rcu_reader.ctr count to become 0.
@@ -180,7 +180,7 @@ void synchronize_rcu(void)
 	/* All threads should read qparity before accessing data structure
 	 * where new ptr points to. */
 	/* Write new ptr before changing the qparity */
-	smp_mb();
+	cmm_smp_mb();
 
 	/* Remove old registry elements */
 	rcu_gc_registry();
@@ -191,11 +191,11 @@ void synchronize_rcu(void)
 	update_counter_and_wait();	/* 0 -> 1, wait readers in parity 0 */
 
 	/*
-	 * Adding a smp_mb() which is _not_ formally required, but makes the
+	 * Adding a cmm_smp_mb() which is _not_ formally required, but makes the
 	 * model easier to understand. It does not have a big performance impact
 	 * anyway, given this is the write-side.
 	 */
-	smp_mb();
+	cmm_smp_mb();
 
 	/*
 	 * Wait for previous parity to be empty of readers.
@@ -206,7 +206,7 @@ void synchronize_rcu(void)
 	 * Finish waiting for reader threads before letting the old ptr being
 	 * freed.
 	 */
-	smp_mb();
+	cmm_smp_mb();
 out:
 	mutex_unlock(&rcu_gp_lock);
 	ret = pthread_sigmask(SIG_SETMASK, &oldmask, NULL);
diff --git a/urcu-defer.c b/urcu-defer.c
index e241302..6dc08a3 100644
--- a/urcu-defer.c
+++ b/urcu-defer.c
@@ -123,13 +123,13 @@ static unsigned long rcu_defer_num_callbacks(void)
 static void wait_defer(void)
 {
 	uatomic_dec(&defer_thread_futex);
-	smp_mb();	/* Write futex before read queue */
+	cmm_smp_mb();	/* Write futex before read queue */
 	if (rcu_defer_num_callbacks()) {
-		smp_mb();	/* Read queue before write futex */
+		cmm_smp_mb();	/* Read queue before write futex */
 		/* Callbacks are queued, don't wait. */
 		uatomic_set(&defer_thread_futex, 0);
 	} else {
-		smp_rmb();	/* Read queue before read futex */
+		cmm_smp_rmb();	/* Read queue before read futex */
 		if (uatomic_read(&defer_thread_futex) == -1)
 			futex_noasync(&defer_thread_futex, FUTEX_WAIT, -1,
 			      NULL, NULL, 0);
@@ -152,7 +152,7 @@ static void rcu_defer_barrier_queue(struct defer_queue *queue,
 	 */
 
 	for (i = queue->tail; i != head;) {
-		smp_rmb();       /* read head before q[]. */
+		cmm_smp_rmb();       /* read head before q[]. */
 		p = LOAD_SHARED(queue->q[i++ & DEFER_QUEUE_MASK]);
 		if (unlikely(DQ_IS_FCT_BIT(p))) {
 			DQ_CLEAR_FCT_BIT(p);
@@ -166,7 +166,7 @@ static void rcu_defer_barrier_queue(struct defer_queue *queue,
 		fct = queue->last_fct_out;
 		fct(p);
 	}
-	smp_mb();	/* push tail after having used q[] */
+	cmm_smp_mb();	/* push tail after having used q[] */
 	STORE_SHARED(queue->tail, i);
 }
 
@@ -283,10 +283,10 @@ void _defer_rcu(void (*fct)(void *p), void *p)
 		}
 	}
 	_STORE_SHARED(defer_queue.q[head++ & DEFER_QUEUE_MASK], p);
-	smp_wmb();	/* Publish new pointer before head */
+	cmm_smp_wmb();	/* Publish new pointer before head */
 			/* Write q[] before head. */
 	STORE_SHARED(defer_queue.head, head);
-	smp_mb();	/* Write queue head before read futex */
+	cmm_smp_mb();	/* Write queue head before read futex */
 	/*
 	 * Wake-up any waiting defer thread.
 	 */
diff --git a/urcu-pointer-static.h b/urcu-pointer-static.h
index 983d0d5..c8ac7f0 100644
--- a/urcu-pointer-static.h
+++ b/urcu-pointer-static.h
@@ -63,7 +63,7 @@ extern "C" {
 
 #define _rcu_dereference(p)     ({					\
 				typeof(p) _________p1 = LOAD_SHARED(p); \
-				smp_read_barrier_depends();		\
+				cmm_smp_read_barrier_depends();		\
 				(_________p1);				\
 				})
 
@@ -81,7 +81,7 @@ extern "C" {
 		typeof(*p) _________pnew = (_new);			\
 		if (!__builtin_constant_p(_new) ||			\
 		    ((_new) != NULL))					\
-			wmb();						\
+			cmm_wmb();						\
 		uatomic_cmpxchg(p, _________pold, _________pnew);	\
 	})
 
@@ -96,7 +96,7 @@ extern "C" {
 		typeof(*p) _________pv = (v);		\
 		if (!__builtin_constant_p(v) ||		\
 		    ((v) != NULL))			\
-			wmb();				\
+			cmm_wmb();				\
 		uatomic_xchg(p, _________pv);		\
 	})
 
@@ -106,7 +106,7 @@ extern "C" {
 		typeof(*p) _________pv = (v);		\
 		if (!__builtin_constant_p(v) || 	\
 		    ((v) != NULL))			\
-			wmb();				\
+			cmm_wmb();				\
 		uatomic_set(p, _________pv);		\
 	})
 
diff --git a/urcu-pointer.c b/urcu-pointer.c
index f5c9811..180c834 100644
--- a/urcu-pointer.c
+++ b/urcu-pointer.c
@@ -39,18 +39,18 @@ void *rcu_dereference_sym(void *p)
 
 void *rcu_set_pointer_sym(void **p, void *v)
 {
-	wmb();
+	cmm_wmb();
 	return uatomic_set(p, v);
 }
 
 void *rcu_xchg_pointer_sym(void **p, void *v)
 {
-	wmb();
+	cmm_wmb();
 	return uatomic_xchg(p, v);
 }
 
 void *rcu_cmpxchg_pointer_sym(void **p, void *old, void *_new)
 {
-	wmb();
+	cmm_wmb();
 	return uatomic_cmpxchg(p, old, _new);
 }
diff --git a/urcu-qsbr-static.h b/urcu-qsbr-static.h
index 147eb18..108ef6e 100644
--- a/urcu-qsbr-static.h
+++ b/urcu-qsbr-static.h
@@ -174,27 +174,27 @@ static inline void _rcu_read_unlock(void)
 
 static inline void _rcu_quiescent_state(void)
 {
-	smp_mb();	
+	cmm_smp_mb();
 	_STORE_SHARED(rcu_reader.ctr, _LOAD_SHARED(rcu_gp_ctr));
-	smp_mb();	/* write rcu_reader.ctr before read futex */
+	cmm_smp_mb();	/* write rcu_reader.ctr before read futex */
 	wake_up_gp();
-	smp_mb();
+	cmm_smp_mb();
 }
 
 static inline void _rcu_thread_offline(void)
 {
-	smp_mb();
+	cmm_smp_mb();
 	STORE_SHARED(rcu_reader.ctr, 0);
-	smp_mb();	/* write rcu_reader.ctr before read futex */
+	cmm_smp_mb();	/* write rcu_reader.ctr before read futex */
 	wake_up_gp();
-	barrier();	/* Ensure the compiler does not reorder us with mutex */
+	cmm_barrier();	/* Ensure the compiler does not reorder us with mutex */
 }
 
 static inline void _rcu_thread_online(void)
 {
-	barrier();	/* Ensure the compiler does not reorder us with mutex */
+	cmm_barrier();	/* Ensure the compiler does not reorder us with mutex */
 	_STORE_SHARED(rcu_reader.ctr, LOAD_SHARED(rcu_gp_ctr));
-	smp_mb();
+	cmm_smp_mb();
 }
 
 #ifdef __cplusplus 
diff --git a/urcu-qsbr.c b/urcu-qsbr.c
index 5e8b960..2cf73d5 100644
--- a/urcu-qsbr.c
+++ b/urcu-qsbr.c
@@ -100,7 +100,7 @@ static void mutex_unlock(pthread_mutex_t *mutex)
 static void wait_gp(void)
 {
 	/* Read reader_gp before read futex */
-	smp_rmb();
+	cmm_smp_rmb();
 	if (uatomic_read(&gp_futex) == -1)
 		futex_noasync(&gp_futex, FUTEX_WAIT, -1,
 		      NULL, NULL, 0);
@@ -126,14 +126,14 @@ static void update_counter_and_wait(void)
 	 * while new readers are always accessing data (no progress). Enforce
 	 * compiler-order of store to rcu_gp_ctr before load rcu_reader ctr.
 	 */
-	barrier();
+	cmm_barrier();
 
 	/*
-	 * Adding a smp_mb() which is _not_ formally required, but makes the
+	 * Adding a cmm_smp_mb() which is _not_ formally required, but makes the
 	 * model easier to understand. It does not have a big performance impact
 	 * anyway, given this is the write-side.
 	 */
-	smp_mb();
+	cmm_smp_mb();
 
 	/*
 	 * Wait for each thread rcu_reader_qs_gp count to become 0.
@@ -143,7 +143,7 @@ static void update_counter_and_wait(void)
 		if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS) {
 			uatomic_dec(&gp_futex);
 			/* Write futex before read reader_gp */
-			smp_mb();
+			cmm_smp_mb();
 		}
 
 		list_for_each_entry_safe(index, tmp, &registry, node) {
@@ -154,7 +154,7 @@ static void update_counter_and_wait(void)
 		if (list_empty(&registry)) {
 			if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS) {
 				/* Read reader_gp before write futex */
-				smp_mb();
+				cmm_smp_mb();
 				uatomic_set(&gp_futex, 0);
 			}
 			break;
@@ -165,7 +165,7 @@ static void update_counter_and_wait(void)
 #ifndef HAS_INCOHERENT_CACHES
 				cpu_relax();
 #else /* #ifndef HAS_INCOHERENT_CACHES */
-				smp_mb();
+				cmm_smp_mb();
 #endif /* #else #ifndef HAS_INCOHERENT_CACHES */
 			}
 		}
@@ -190,7 +190,7 @@ void synchronize_rcu(void)
 	 * where new ptr points to.
 	 */
 	/* Write new ptr before changing the qparity */
-	smp_mb();
+	cmm_smp_mb();
 
 	/*
 	 * Mark the writer thread offline to make sure we don't wait for
@@ -217,14 +217,14 @@ void synchronize_rcu(void)
 	 * accessing data (no progress).  Enforce compiler-order of load
 	 * rcu_reader ctr before store to rcu_gp_ctr.
 	 */
-	barrier();
+	cmm_barrier();
 
 	/*
-	 * Adding a smp_mb() which is _not_ formally required, but makes the
+	 * Adding a cmm_smp_mb() which is _not_ formally required, but makes the
 	 * model easier to understand. It does not have a big performance impact
 	 * anyway, given this is the write-side.
 	 */
-	smp_mb();
+	cmm_smp_mb();
 
 	/*
 	 * Wait for previous parity to be empty of readers.
@@ -239,7 +239,7 @@ out:
 	 */
 	if (was_online)
 		_STORE_SHARED(rcu_reader.ctr, LOAD_SHARED(rcu_gp_ctr));
-	smp_mb();
+	cmm_smp_mb();
 }
 #else /* !(BITS_PER_LONG < 64) */
 void synchronize_rcu(void)
@@ -253,7 +253,7 @@ void synchronize_rcu(void)
 	 * our own quiescent state. This allows using synchronize_rcu() in
 	 * threads registered as readers.
 	 */
-	smp_mb();
+	cmm_smp_mb();
 	if (was_online)
 		STORE_SHARED(rcu_reader.ctr, 0);
 
@@ -266,7 +266,7 @@ out:
 
 	if (was_online)
 		_STORE_SHARED(rcu_reader.ctr, LOAD_SHARED(rcu_gp_ctr));
-	smp_mb();
+	cmm_smp_mb();
 }
 #endif  /* !(BITS_PER_LONG < 64) */
 
diff --git a/urcu-static.h b/urcu-static.h
index eea39bb..ad415ac 100644
--- a/urcu-static.h
+++ b/urcu-static.h
@@ -181,23 +181,23 @@ extern int has_sys_membarrier;
 static inline void smp_mb_slave(int group)
 {
 	if (likely(has_sys_membarrier))
-		barrier();
+		cmm_barrier();
 	else
-		smp_mb();
+		cmm_smp_mb();
 }
 #endif
 
 #ifdef RCU_MB
 static inline void smp_mb_slave(int group)
 {
-	smp_mb();
+	cmm_smp_mb();
 }
 #endif
 
 #ifdef RCU_SIGNAL
 static inline void smp_mb_slave(int group)
 {
-	barrier();
+	cmm_barrier();
 }
 #endif
 
@@ -259,7 +259,7 @@ static inline void _rcu_read_lock(void)
 {
 	unsigned long tmp;
 
-	barrier();	/* Ensure the compiler does not reorder us with mutex */
+	cmm_barrier();	/* Ensure the compiler does not reorder us with mutex */
 	tmp = rcu_reader.ctr;
 	/*
 	 * rcu_gp_ctr is
@@ -295,7 +295,7 @@ static inline void _rcu_read_unlock(void)
 	} else {
 		_STORE_SHARED(rcu_reader.ctr, rcu_reader.ctr - RCU_GP_COUNT);
 	}
-	barrier();	/* Ensure the compiler does not reorder us with mutex */
+	cmm_barrier();	/* Ensure the compiler does not reorder us with mutex */
 }
 
 #ifdef __cplusplus
diff --git a/urcu.c b/urcu.c
index 918d274..9c556aa 100644
--- a/urcu.c
+++ b/urcu.c
@@ -100,9 +100,9 @@ static void mutex_lock(pthread_mutex_t *mutex)
 			exit(-1);
 		}
 		if (LOAD_SHARED(rcu_reader.need_mb)) {
-			smp_mb();
+			cmm_smp_mb();
 			_STORE_SHARED(rcu_reader.need_mb, 0);
-			smp_mb();
+			cmm_smp_mb();
 		}
 		poll(NULL,0,10);
 	}
@@ -126,14 +126,14 @@ static void smp_mb_master(int group)
 	if (likely(has_sys_membarrier))
 		membarrier(MEMBARRIER_EXPEDITED);
 	else
-		smp_mb();
+		cmm_smp_mb();
 }
 #endif
 
 #ifdef RCU_MB
 static void smp_mb_master(int group)
 {
-	smp_mb();
+	cmm_smp_mb();
 }
 #endif
 
@@ -143,15 +143,15 @@ static void force_mb_all_readers(void)
 	struct rcu_reader *index;
 
 	/*
-	 * Ask for each threads to execute a smp_mb() so we can consider the
+	 * Ask for each threads to execute a cmm_smp_mb() so we can consider the
 	 * compiler barriers around rcu read lock as real memory barriers.
 	 */
 	if (list_empty(&registry))
 		return;
 	/*
-	 * pthread_kill has a smp_mb(). But beware, we assume it performs
+	 * pthread_kill has a cmm_smp_mb(). But beware, we assume it performs
 	 * a cache flush on architectures with non-coherent cache. Let's play
-	 * safe and don't assume anything : we use smp_mc() to make sure the
+	 * safe and don't assume anything : we use cmm_smp_mc() to make sure the
 	 * cache flush is enforced.
 	 */
 	list_for_each_entry(index, &registry, node) {
@@ -177,7 +177,7 @@ static void force_mb_all_readers(void)
 			poll(NULL, 0, 1);
 		}
 	}
-	smp_mb();	/* read ->need_mb before ending the barrier */
+	cmm_smp_mb();	/* read ->need_mb before ending the barrier */
 }
 
 static void smp_mb_master(int group)
@@ -213,15 +213,15 @@ void update_counter_and_wait(void)
 	 * while new readers are always accessing data (no progress). Enforce
 	 * compiler-order of store to rcu_gp_ctr before load rcu_reader ctr.
 	 */
-	barrier();
+	cmm_barrier();
 
 	/*
 	 *
-	 * Adding a smp_mb() which is _not_ formally required, but makes the
+	 * Adding a cmm_smp_mb() which is _not_ formally required, but makes the
 	 * model easier to understand. It does not have a big performance impact
 	 * anyway, given this is the write-side.
 	 */
-	smp_mb();
+	cmm_smp_mb();
 
 	/*
 	 * Wait for each thread rcu_reader.ctr count to become 0.
@@ -309,14 +309,14 @@ void synchronize_rcu(void)
 	 * accessing data (no progress).  Enforce compiler-order of load
 	 * rcu_reader ctr before store to rcu_gp_ctr.
 	 */
-	barrier();
+	cmm_barrier();
 
 	/*
-	 * Adding a smp_mb() which is _not_ formally required, but makes the
+	 * Adding a cmm_smp_mb() which is _not_ formally required, but makes the
 	 * model easier to understand. It does not have a big performance impact
 	 * anyway, given this is the write-side.
 	 */
-	smp_mb();
+	cmm_smp_mb();
 
 	/*
 	 * Wait for previous parity to be empty of readers.
@@ -379,13 +379,13 @@ void rcu_init(void)
 static void sigrcu_handler(int signo, siginfo_t *siginfo, void *context)
 {
 	/*
-	 * Executing this smp_mb() is the only purpose of this signal handler.
-	 * It punctually promotes barrier() into smp_mb() on every thread it is
+	 * Executing this cmm_smp_mb() is the only purpose of this signal handler.
+	 * It punctually promotes cmm_barrier() into cmm_smp_mb() on every thread it is
 	 * executed on.
 	 */
-	smp_mb();
+	cmm_smp_mb();
 	_STORE_SHARED(rcu_reader.need_mb, 0);
-	smp_mb();
+	cmm_smp_mb();
 }
 
 /*
diff --git a/urcu/arch_alpha.h b/urcu/arch_alpha.h
index 0596939..51a1fff 100644
--- a/urcu/arch_alpha.h
+++ b/urcu/arch_alpha.h
@@ -28,9 +28,9 @@
 extern "C" {
 #endif
 
-#define mb()			asm volatile("mb":::"memory")
-#define wmb()			asm volatile("wmb":::"memory")
-#define read_barrier_depends()	asm volatile("mb":::"memory")
+#define cmm_mb()			asm volatile("mb":::"memory")
+#define cmm_wmb()			asm volatile("wmb":::"memory")
+#define cmm_read_barrier_depends()	asm volatile("mb":::"memory")
 
 typedef unsigned long long cycles_t;
 
diff --git a/urcu/arch_armv7l.h b/urcu/arch_armv7l.h
index e63ad3c..6d58bb7 100644
--- a/urcu/arch_armv7l.h
+++ b/urcu/arch_armv7l.h
@@ -29,7 +29,7 @@
 extern "C" {
 #endif 
 
-#define mb()    asm volatile("dmb":::"memory")
+#define cmm_mb()    asm volatile("dmb":::"memory")
 
 #include <stdlib.h>
 #include <sys/time.h>
diff --git a/urcu/arch_generic.h b/urcu/arch_generic.h
index 36a0003..25a9f7a 100644
--- a/urcu/arch_generic.h
+++ b/urcu/arch_generic.h
@@ -32,93 +32,93 @@ extern "C" {
 #define CACHE_LINE_SIZE	64
 #endif
 
-#if !defined(mc) && !defined(rmc) && !defined(wmc)
+#if !defined(cmm_mc) && !defined(cmm_rmc) && !defined(cmm_wmc)
 #define CONFIG_HAVE_MEM_COHERENCY
 /*
- * Architectures with cache coherency must _not_ define mc/rmc/wmc.
+ * Architectures with cache coherency must _not_ define cmm_mc/cmm_rmc/cmm_wmc.
  *
- * For them, mc/rmc/wmc are implemented with a * simple compiler barrier;
- * in addition, we provide defaults for mb (using GCC builtins) as well as
- * rmb and wmb (defaulting to mb).
+ * For them, cmm_mc/cmm_rmc/cmm_wmc are implemented with a * simple compiler barrier;
+ * in addition, we provide defaults for cmm_mb (using GCC builtins) as well as
+ * cmm_rmb and cmm_wmb (defaulting to cmm_mb).
  */
 
-#ifndef mb
-#define mb()    __sync_synchronize()
+#ifndef cmm_mb
+#define cmm_mb()    __sync_synchronize()
 #endif
 
-#ifndef rmb
-#define rmb()    mb()
+#ifndef cmm_rmb
+#define cmm_rmb()	cmm_mb()
 #endif
 
-#ifndef wmb
-#define wmb()    mb()
+#ifndef cmm_wmb
+#define cmm_wmb()	cmm_mb()
 #endif
 
-#define mc()	 barrier()
-#define rmc()	 barrier()
-#define wmc()	 barrier()
+#define cmm_mc()	cmm_barrier()
+#define cmm_rmc()	cmm_barrier()
+#define cmm_wmc()	cmm_barrier()
 #else
 /*
  * Architectures without cache coherency need something like the following:
  *
- * #define mc()		arch_cache_flush() 
- * #define rmc()	arch_cache_flush_read()
- * #define wmc()	arch_cache_flush_write()
+ * #define cmm_mc()		arch_cache_flush() 
+ * #define cmm_rmc()	arch_cache_flush_read()
+ * #define cmm_wmc()	arch_cache_flush_write()
  *
- * Of these, only mc is mandatory.  rmc and wmc default to mc.  mb/rmb/wmb
- * use these definitions by default:
+ * Of these, only cmm_mc is mandatory.  cmm_rmc and cmm_wmc default to cmm_mc.  
+ * cmm_mb/cmm_rmb/cmm_wmb use these definitions by default:
  *
- * #define mb()		mc()
- * #define rmb()	rmc()
- * #define wmb()	wmc()
+ * #define cmm_mb()		cmm_mc()
+ * #define cmm_rmb()	cmm_rmc()
+ * #define cmm_wmb()	cmm_wmc()
  */
 
-#ifndef mb
-#define mb()    mc()
+#ifndef cmm_mb
+#define cmm_mb()	cmm_mc()
 #endif
 
-#ifndef rmb
-#define rmb()    rmc()
+#ifndef cmm_rmb
+#define cmm_rmb()	cmm_rmc()
 #endif
 
-#ifndef wmb
-#define wmb()    wmc()
+#ifndef cmm_wmb
+#define cmm_wmb()	cmm_wmc()
 #endif
 
-#ifndef rmc
-#define rmc()    mc()
+#ifndef cmm_rmc
+#define cmm_rmc()	cmm_mc()
 #endif
 
-#ifndef wmc
-#define wmc()    mc()
+#ifndef cmm_wmc
+#define cmm_wmc()	cmm_mc()
 #endif
 #endif
 
 /* Nop everywhere except on alpha. */
-#ifndef read_barrier_depends
-#define read_barrier_depends()
+#ifndef cmm_read_barrier_depends
+#define cmm_read_barrier_depends()
 #endif
 
 #ifdef CONFIG_RCU_SMP
-#define smp_mb()	mb()
-#define smp_rmb()	rmb()
-#define smp_wmb()	wmb()
-#define smp_mc()	mc()
-#define smp_rmc()	rmc()
-#define smp_wmc()	wmc()
-#define smp_read_barrier_depends()	read_barrier_depends()
+#define cmm_smp_mb()	cmm_mb()
+#define cmm_smp_rmb()	cmm_rmb()
+#define cmm_smp_wmb()	cmm_wmb()
+#define cmm_smp_mc()	cmm_mc()
+#define cmm_smp_rmc()	cmm_rmc()
+#define cmm_smp_wmc()	cmm_wmc()
+#define cmm_smp_read_barrier_depends()	cmm_read_barrier_depends()
 #else
-#define smp_mb()	barrier()
-#define smp_rmb()	barrier()
-#define smp_wmb()	barrier()
-#define smp_mc()	barrier()
-#define smp_rmc()	barrier()
-#define smp_wmc()	barrier()
-#define smp_read_barrier_depends()
+#define cmm_smp_mb()	cmm_barrier()
+#define cmm_smp_rmb()	cmm_barrier()
+#define cmm_smp_wmb()	cmm_barrier()
+#define cmm_smp_mc()	cmm_barrier()
+#define cmm_smp_rmc()	cmm_barrier()
+#define cmm_smp_wmc()	cmm_barrier()
+#define cmm_smp_read_barrier_depends()
 #endif
 
 #ifndef cpu_relax
-#define cpu_relax()	 barrier()
+#define cpu_relax()		cmm_barrier()
 #endif
 
 #ifdef __cplusplus
diff --git a/urcu/arch_ppc.h b/urcu/arch_ppc.h
index 7a217c8..93aed2a 100644
--- a/urcu/arch_ppc.h
+++ b/urcu/arch_ppc.h
@@ -32,7 +32,7 @@ extern "C" {
 /* Include size of POWER5+ L3 cache lines: 256 bytes */
 #define CACHE_LINE_SIZE	256
 
-#define mb()    asm volatile("sync":::"memory")
+#define cmm_mb()    asm volatile("sync":::"memory")
 
 #define mftbl()						\
 	({ 						\
@@ -56,9 +56,9 @@ static inline cycles_t get_cycles (void)
 
 	for (;;) {
 		h = mftbu();
-		barrier();
+		cmm_barrier();
 		l = mftbl();
-		barrier();
+		cmm_barrier();
 		if (mftbu() == h)
 			return (((cycles_t) h) << 32) + l;
 	}
diff --git a/urcu/arch_s390.h b/urcu/arch_s390.h
index 1a55e0d..8a33e20 100644
--- a/urcu/arch_s390.h
+++ b/urcu/arch_s390.h
@@ -37,7 +37,7 @@ extern "C" {
 
 #define CACHE_LINE_SIZE	128
 
-#define mb()    __asm__ __volatile__("bcr 15,0" : : : "memory")
+#define cmm_mb()    __asm__ __volatile__("bcr 15,0" : : : "memory")
 
 typedef unsigned long long cycles_t;
 
diff --git a/urcu/arch_sparc64.h b/urcu/arch_sparc64.h
index 8e991b1..39f27c7 100644
--- a/urcu/arch_sparc64.h
+++ b/urcu/arch_sparc64.h
@@ -40,9 +40,9 @@ __asm__ __volatile__("ba,pt %%xcc, 1f\n\t"	\
 		     "1:\n"			\
 		     : : : "memory")
 
-#define mb()    membar_safe("#LoadLoad | #LoadStore | #StoreStore | #StoreLoad")
-#define rmb()    membar_safe("#LoadLoad")
-#define wmb()    membar_safe("#StoreStore")
+#define cmm_mb()	membar_safe("#LoadLoad | #LoadStore | #StoreStore | #StoreLoad")
+#define cmm_rmb()	membar_safe("#LoadLoad")
+#define cmm_wmb()	membar_safe("#StoreStore")
 
 typedef unsigned long long cycles_t;
 
diff --git a/urcu/arch_x86.h b/urcu/arch_x86.h
index aad541e..d0a58e8 100644
--- a/urcu/arch_x86.h
+++ b/urcu/arch_x86.h
@@ -32,17 +32,17 @@ extern "C" {
 #define CACHE_LINE_SIZE	128
 
 #ifdef CONFIG_RCU_HAVE_FENCE
-#define mb()    asm volatile("mfence":::"memory")
-#define rmb()   asm volatile("lfence":::"memory")
-#define wmb()   asm volatile("sfence"::: "memory")
+#define cmm_mb()    asm volatile("mfence":::"memory")
+#define cmm_rmb()   asm volatile("lfence":::"memory")
+#define cmm_wmb()   asm volatile("sfence"::: "memory")
 #else
 /*
- * Some non-Intel clones support out of order store. wmb() ceases to be a
+ * Some non-Intel clones support out of order store. cmm_wmb() ceases to be a
  * nop for these.
  */
-#define mb()    asm volatile("lock; addl $0,0(%%esp)":::"memory")
-#define rmb()   asm volatile("lock; addl $0,0(%%esp)":::"memory")
-#define wmb()   asm volatile("lock; addl $0,0(%%esp)"::: "memory")
+#define cmm_mb()    asm volatile("lock; addl $0,0(%%esp)":::"memory")
+#define cmm_rmb()   asm volatile("lock; addl $0,0(%%esp)":::"memory")
+#define cmm_wmb()   asm volatile("lock; addl $0,0(%%esp)"::: "memory")
 #endif
 
 #define cpu_relax()	asm volatile("rep; nop" : : : "memory");
diff --git a/urcu/compiler.h b/urcu/compiler.h
index fb8b829..d67e6c5 100644
--- a/urcu/compiler.h
+++ b/urcu/compiler.h
@@ -23,7 +23,7 @@
 #define likely(x)	__builtin_expect(!!(x), 1)
 #define unlikely(x)	__builtin_expect(!!(x), 0)
 
-#define	barrier()	asm volatile("" : : : "memory")
+#define	cmm_barrier()	asm volatile("" : : : "memory")
 
 /*
  * Instruct the compiler to perform only a single access to a variable
diff --git a/urcu/rcuhlist.h b/urcu/rcuhlist.h
index 89f7679..cce80aa 100644
--- a/urcu/rcuhlist.h
+++ b/urcu/rcuhlist.h
@@ -35,7 +35,7 @@ static inline void hlist_add_head_rcu(struct hlist_node *newp,
 {
 	newp->next = head->next;
 	newp->prev = (struct hlist_node *)head;
-	smp_wmb();
+	cmm_smp_wmb();
 	if (head->next)
 		head->next->prev = newp;
 	head->next = newp;
diff --git a/urcu/rculist.h b/urcu/rculist.h
index b0c4f1a..3a4e335 100644
--- a/urcu/rculist.h
+++ b/urcu/rculist.h
@@ -34,7 +34,7 @@ static inline void list_add_rcu(list_t *newp, list_t *head)
 {
 	newp->next = head->next;
 	newp->prev = head;
-	smp_wmb();
+	cmm_smp_wmb();
 	head->next->prev = newp;
 	head->next = newp;
 }
diff --git a/urcu/system.h b/urcu/system.h
index 0de7dd2..11a499e 100644
--- a/urcu/system.h
+++ b/urcu/system.h
@@ -22,7 +22,7 @@
 #include <urcu/arch.h>
 
 /*
- * Identify a shared load. A smp_rmc() or smp_mc() should come before the load.
+ * Identify a shared load. A cmm_smp_rmc() or cmm_smp_mc() should come before the load.
  */
 #define _LOAD_SHARED(p)	       ACCESS_ONCE(p)
 
@@ -31,12 +31,12 @@
  */
 #define LOAD_SHARED(p)			\
 	({				\
-		smp_rmc();		\
+		cmm_smp_rmc();		\
 		_LOAD_SHARED(p);	\
 	})
 
 /*
- * Identify a shared store. A smp_wmc() or smp_mc() should follow the store.
+ * Identify a shared store. A cmm_smp_wmc() or cmm_smp_mc() should follow the store.
  */
 #define _STORE_SHARED(x, v)	({ ACCESS_ONCE(x) = (v); })
 
@@ -47,7 +47,7 @@
 #define STORE_SHARED(x, v)		\
 	({				\
 		typeof(x) _v = _STORE_SHARED(x, v);	\
-		smp_wmc();		\
+		cmm_smp_wmc();		\
 		_v;			\
 	})
 
-- 
1.7.3.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ltt-dev] [URCU PATCH 2/3] Rename all arch primitives with prefix caa_
  2010-11-18 20:31 [ltt-dev] [URCU PATCH 1/3] Rename all memory primitives with prefix cmm_ David Goulet
@ 2010-11-18 20:31 ` David Goulet
  2010-11-18 20:31 ` [ltt-dev] [URCU PATCH 3/3] Rename all data structure with prefix cds_ David Goulet
  2010-11-18 20:57 ` [ltt-dev] [URCU PATCH 1/3] Rename all memory primitives with prefix cmm_ Mathieu Desnoyers
  2 siblings, 0 replies; 4+ messages in thread
From: David Goulet @ 2010-11-18 20:31 UTC (permalink / raw)


This is the second patch for reducing namespace pollution.
The caa_ prefix stands for Concurrent Architecture Abstraction.
Again, suggested by Mathieu Desnoyers and Paul E. Mckenney.

Every define, macro and function specific to the architecture
abstraction of liburcu is modified with that prefix

Signed-off-by: David Goulet <david.goulet at polymtl.ca>
---
 tests/api_gcc.h                   |   16 ++++++++--------
 tests/api_ppc.h                   |   16 ++++++++--------
 tests/api_x86.h                   |   16 ++++++++--------
 tests/rcutorture.h                |    2 +-
 tests/test_cycles_per_loop.c      |    6 +++---
 tests/test_looplen.c              |    6 +++---
 tests/test_mutex.c                |    6 +++---
 tests/test_perthreadlock.c        |    8 ++++----
 tests/test_perthreadlock_timing.c |   14 +++++++-------
 tests/test_qsbr.c                 |    2 +-
 tests/test_qsbr_gc.c              |    8 ++++----
 tests/test_qsbr_timing.c          |   12 ++++++------
 tests/test_rwlock.c               |    2 +-
 tests/test_rwlock_timing.c        |   12 ++++++------
 tests/test_urcu.c                 |    2 +-
 tests/test_urcu_assign.c          |    2 +-
 tests/test_urcu_bp.c              |    2 +-
 tests/test_urcu_defer.c           |    4 ++--
 tests/test_urcu_gc.c              |    8 ++++----
 tests/test_urcu_lfq.c             |    6 +++---
 tests/test_urcu_lfs.c             |    2 +-
 tests/test_urcu_timing.c          |   12 ++++++------
 tests/test_urcu_wfq.c             |    2 +-
 tests/test_urcu_wfs.c             |    2 +-
 urcu-bp-static.h                  |   10 +++++-----
 urcu-bp.c                         |    6 +++---
 urcu-defer.c                      |   32 ++++++++++++++++----------------
 urcu-pointer-static.h             |    4 ++--
 urcu-qsbr-static.h                |   10 +++++-----
 urcu-qsbr.c                       |   14 +++++++-------
 urcu-static.h                     |   12 ++++++------
 urcu.c                            |   16 ++++++++--------
 urcu/arch_generic.h               |    8 ++++----
 urcu/arch_ppc.h                   |    2 +-
 urcu/arch_s390.h                  |    2 +-
 urcu/arch_sparc64.h               |    2 +-
 urcu/arch_x86.h                   |    6 +++---
 urcu/compiler.h                   |   14 +++++++-------
 urcu/system.h                     |   12 ++++++------
 urcu/uatomic_arch_x86.h           |    2 +-
 urcu/uatomic_generic.h            |    4 ++--
 urcu/wfqueue-static.h             |    8 ++++----
 urcu/wfstack-static.h             |    8 ++++----
 43 files changed, 170 insertions(+), 170 deletions(-)

diff --git a/tests/api_gcc.h b/tests/api_gcc.h
index b23110d..632bdd5 100644
--- a/tests/api_gcc.h
+++ b/tests/api_gcc.h
@@ -73,7 +73,7 @@
  * Machine parameters.
  */
 
-/* #define CACHE_LINE_SIZE 64 */
+/* #define CAA_CACHE_LINE_SIZE 64 */
 #define ____cacheline_internodealigned_in_smp \
 	__attribute__((__aligned__(1 << 6)))
 
@@ -295,9 +295,9 @@ cmpxchg(volatile long *ptr, long oldval, long newval)
  * Default machine parameters.
  */
 
-#ifndef CACHE_LINE_SIZE
-/* #define CACHE_LINE_SIZE 128 */
-#endif /* #ifndef CACHE_LINE_SIZE */
+#ifndef CAA_CACHE_LINE_SIZE
+/* #define CAA_CACHE_LINE_SIZE 128 */
+#endif /* #ifndef CAA_CACHE_LINE_SIZE */
 
 /*
  * Exclusive locking primitives.
@@ -497,7 +497,7 @@ long long get_microseconds(void)
 #define DEFINE_PER_THREAD(type, name) \
 	struct { \
 		__typeof__(type) v \
-			__attribute__((__aligned__(CACHE_LINE_SIZE))); \
+			__attribute__((__aligned__(CAA_CACHE_LINE_SIZE))); \
 	} __per_thread_##name[NR_THREADS];
 #define DECLARE_PER_THREAD(type, name) extern DEFINE_PER_THREAD(type, name)
 
@@ -531,7 +531,7 @@ long long get_microseconds(void)
 #define DEFINE_PER_CPU(type, name) \
 	struct { \
 		__typeof__(type) v \
-			__attribute__((__aligned__(CACHE_LINE_SIZE))); \
+			__attribute__((__aligned__(CAA_CACHE_LINE_SIZE))); \
 	} __per_cpu_##name[NR_CPUS]
 #define DECLARE_PER_CPU(type, name) extern DEFINE_PER_CPU(type, name)
 
@@ -972,7 +972,7 @@ static inline void list_splice_tail_init(struct list_head *list,
  * @member:	the name of the list_struct within the struct.
  */
 #define list_entry(ptr, type, member) \
-	container_of(ptr, type, member)
+	caa_container_of(ptr, type, member)
 
 /**
  * list_first_entry - get the first element from a list
@@ -1274,7 +1274,7 @@ static inline void hlist_move_list(struct hlist_head *old,
 	old->first = NULL;
 }
 
-#define hlist_entry(ptr, type, member) container_of(ptr,type,member)
+#define hlist_entry(ptr, type, member) caa_container_of(ptr,type,member)
 
 #define hlist_for_each(pos, head) \
 	for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \
diff --git a/tests/api_ppc.h b/tests/api_ppc.h
index 9773500..5c5f6e9 100644
--- a/tests/api_ppc.h
+++ b/tests/api_ppc.h
@@ -76,7 +76,7 @@
 
 #define CONFIG_PPC64
 
-/*#define CACHE_LINE_SIZE 128 */
+/*#define CAA_CACHE_LINE_SIZE 128 */
 #define ____cacheline_internodealigned_in_smp \
 	__attribute__((__aligned__(1 << 7)))
 
@@ -660,9 +660,9 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
  * Default machine parameters.
  */
 
-#ifndef CACHE_LINE_SIZE
-/* #define CACHE_LINE_SIZE 128 */
-#endif /* #ifndef CACHE_LINE_SIZE */
+#ifndef CAA_CACHE_LINE_SIZE
+/* #define CAA_CACHE_LINE_SIZE 128 */
+#endif /* #ifndef CAA_CACHE_LINE_SIZE */
 
 /*
  * Exclusive locking primitives.
@@ -855,7 +855,7 @@ long long get_microseconds(void)
 #define DEFINE_PER_THREAD(type, name) \
 	struct { \
 		__typeof__(type) v \
-			__attribute__((__aligned__(CACHE_LINE_SIZE))); \
+			__attribute__((__aligned__(CAA_CACHE_LINE_SIZE))); \
 	} __per_thread_##name[NR_THREADS];
 #define DECLARE_PER_THREAD(type, name) extern DEFINE_PER_THREAD(type, name)
 
@@ -889,7 +889,7 @@ long long get_microseconds(void)
 #define DEFINE_PER_CPU(type, name) \
 	struct { \
 		__typeof__(type) v \
-			__attribute__((__aligned__(CACHE_LINE_SIZE))); \
+			__attribute__((__aligned__(CAA_CACHE_LINE_SIZE))); \
 	} __per_cpu_##name[NR_CPUS]
 #define DECLARE_PER_CPU(type, name) extern DEFINE_PER_CPU(type, name)
 
@@ -1331,7 +1331,7 @@ static inline void list_splice_tail_init(struct list_head *list,
  * @member:	the name of the list_struct within the struct.
  */
 #define list_entry(ptr, type, member) \
-	container_of(ptr, type, member)
+	caa_container_of(ptr, type, member)
 
 /**
  * list_first_entry - get the first element from a list
@@ -1633,7 +1633,7 @@ static inline void hlist_move_list(struct hlist_head *old,
 	old->first = NULL;
 }
 
-#define hlist_entry(ptr, type, member) container_of(ptr,type,member)
+#define hlist_entry(ptr, type, member) caa_container_of(ptr,type,member)
 
 #define hlist_for_each(pos, head) \
 	for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \
diff --git a/tests/api_x86.h b/tests/api_x86.h
index fe00a35..0365432 100644
--- a/tests/api_x86.h
+++ b/tests/api_x86.h
@@ -76,7 +76,7 @@
  * Machine parameters.
  */
 
-/* #define CACHE_LINE_SIZE 64 */
+/* #define CAA_CACHE_LINE_SIZE 64 */
 #define ____cacheline_internodealigned_in_smp \
 	__attribute__((__aligned__(1 << 6)))
 
@@ -356,9 +356,9 @@ __asm__ __volatile__(LOCK_PREFIX "orl %0,%1" \
  * Default machine parameters.
  */
 
-#ifndef CACHE_LINE_SIZE
-/* #define CACHE_LINE_SIZE 128 */
-#endif /* #ifndef CACHE_LINE_SIZE */
+#ifndef CAA_CACHE_LINE_SIZE
+/* #define CAA_CACHE_LINE_SIZE 128 */
+#endif /* #ifndef CAA_CACHE_LINE_SIZE */
 
 /*
  * Exclusive locking primitives.
@@ -558,7 +558,7 @@ long long get_microseconds(void)
 #define DEFINE_PER_THREAD(type, name) \
 	struct { \
 		__typeof__(type) v \
-			__attribute__((__aligned__(CACHE_LINE_SIZE))); \
+			__attribute__((__aligned__(CAA_CACHE_LINE_SIZE))); \
 	} __per_thread_##name[NR_THREADS];
 #define DECLARE_PER_THREAD(type, name) extern DEFINE_PER_THREAD(type, name)
 
@@ -592,7 +592,7 @@ long long get_microseconds(void)
 #define DEFINE_PER_CPU(type, name) \
 	struct { \
 		__typeof__(type) v \
-			__attribute__((__aligned__(CACHE_LINE_SIZE))); \
+			__attribute__((__aligned__(CAA_CACHE_LINE_SIZE))); \
 	} __per_cpu_##name[NR_CPUS]
 #define DECLARE_PER_CPU(type, name) extern DEFINE_PER_CPU(type, name)
 
@@ -1034,7 +1034,7 @@ static inline void list_splice_tail_init(struct list_head *list,
  * @member:	the name of the list_struct within the struct.
  */
 #define list_entry(ptr, type, member) \
-	container_of(ptr, type, member)
+	caa_container_of(ptr, type, member)
 
 /**
  * list_first_entry - get the first element from a list
@@ -1336,7 +1336,7 @@ static inline void hlist_move_list(struct hlist_head *old,
 	old->first = NULL;
 }
 
-#define hlist_entry(ptr, type, member) container_of(ptr,type,member)
+#define hlist_entry(ptr, type, member) caa_container_of(ptr,type,member)
 
 #define hlist_for_each(pos, head) \
 	for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \
diff --git a/tests/rcutorture.h b/tests/rcutorture.h
index 4192bd0..4dac2f2 100644
--- a/tests/rcutorture.h
+++ b/tests/rcutorture.h
@@ -77,7 +77,7 @@ char argsbuf[64];
 #define GOFLAG_RUN  1
 #define GOFLAG_STOP 2
 
-int goflag __attribute__((__aligned__(CACHE_LINE_SIZE))) = GOFLAG_INIT;
+int goflag __attribute__((__aligned__(CAA_CACHE_LINE_SIZE))) = GOFLAG_INIT;
 
 #define RCU_READ_RUN 1000
 
diff --git a/tests/test_cycles_per_loop.c b/tests/test_cycles_per_loop.c
index 64b160b..05a6ea7 100644
--- a/tests/test_cycles_per_loop.c
+++ b/tests/test_cycles_per_loop.c
@@ -6,16 +6,16 @@
 static inline void loop_sleep(unsigned long l)
 {
 	while(l-- != 0)
-		cpu_relax();
+		caa_cpu_relax();
 }
 
 int main()
 {
 	cycles_t time1, time2;
 
-	time1 = get_cycles();
+	time1 = caa_get_cycles();
 	loop_sleep(NR_LOOPS);
-	time2 = get_cycles();
+	time2 = caa_get_cycles();
 	printf("CPU clock cycles per loop: %g\n", (time2 - time1) /
 						  (double)NR_LOOPS);
 }
diff --git a/tests/test_looplen.c b/tests/test_looplen.c
index 53d39cd..01394e0 100644
--- a/tests/test_looplen.c
+++ b/tests/test_looplen.c
@@ -61,7 +61,7 @@ static inline pid_t gettid(void)
 static inline void loop_sleep(unsigned long l)
 {
 	while(l-- != 0)
-		cpu_relax();
+		caa_cpu_relax();
 }
 
 #define LOOPS 1048576
@@ -75,9 +75,9 @@ int main(int argc, char **argv)
 	double cpl;
 
 	for (i = 0; i < TESTS; i++) {
-		time1 = get_cycles();
+		time1 = caa_get_cycles();
 		loop_sleep(LOOPS);
-		time2 = get_cycles();
+		time2 = caa_get_cycles();
 		time_tot += time2 - time1;
 	}
 	cpl = ((double)time_tot) / (double)TESTS / (double)LOOPS;
diff --git a/tests/test_mutex.c b/tests/test_mutex.c
index 7dd1e31..747bcc4 100644
--- a/tests/test_mutex.c
+++ b/tests/test_mutex.c
@@ -85,7 +85,7 @@ static unsigned long wduration;
 static inline void loop_sleep(unsigned long l)
 {
 	while(l-- != 0)
-		cpu_relax();
+		caa_cpu_relax();
 }
 
 static int verbose_mode;
@@ -156,9 +156,9 @@ static unsigned long long __thread nr_writes;
 static unsigned long long __thread nr_reads;
 
 static
-unsigned long long __attribute__((aligned(CACHE_LINE_SIZE))) *tot_nr_writes;
+unsigned long long __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *tot_nr_writes;
 static
-unsigned long long __attribute__((aligned(CACHE_LINE_SIZE))) *tot_nr_reads;
+unsigned long long __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *tot_nr_reads;
 
 static unsigned int nr_readers;
 static unsigned int nr_writers;
diff --git a/tests/test_perthreadlock.c b/tests/test_perthreadlock.c
index 9de8ced..c233724 100644
--- a/tests/test_perthreadlock.c
+++ b/tests/test_perthreadlock.c
@@ -68,7 +68,7 @@ struct test_array {
 
 struct per_thread_lock {
 	pthread_mutex_t lock;
-} __attribute__((aligned(CACHE_LINE_SIZE)));	/* cache-line aligned */
+} __attribute__((aligned(CAA_CACHE_LINE_SIZE)));	/* cache-line aligned */
 
 static struct per_thread_lock *per_thread_lock;
 
@@ -89,7 +89,7 @@ static unsigned long wduration;
 static inline void loop_sleep(unsigned long l)
 {
 	while(l-- != 0)
-		cpu_relax();
+		caa_cpu_relax();
 }
 
 static int verbose_mode;
@@ -160,9 +160,9 @@ static unsigned long long __thread nr_writes;
 static unsigned long long __thread nr_reads;
 
 static
-unsigned long long __attribute__((aligned(CACHE_LINE_SIZE))) *tot_nr_writes;
+unsigned long long __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *tot_nr_writes;
 static
-unsigned long long __attribute__((aligned(CACHE_LINE_SIZE))) *tot_nr_reads;
+unsigned long long __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *tot_nr_reads;
 
 static unsigned int nr_readers;
 static unsigned int nr_writers;
diff --git a/tests/test_perthreadlock_timing.c b/tests/test_perthreadlock_timing.c
index 9eb1c13..26b642a 100644
--- a/tests/test_perthreadlock_timing.c
+++ b/tests/test_perthreadlock_timing.c
@@ -60,7 +60,7 @@ static struct test_array test_array = { 8 };
 
 struct per_thread_lock {
 	pthread_mutex_t lock;
-} __attribute__((aligned(CACHE_LINE_SIZE)));	/* cache-line aligned */
+} __attribute__((aligned(CAA_CACHE_LINE_SIZE)));	/* cache-line aligned */
 
 static struct per_thread_lock *per_thread_lock;
 
@@ -78,8 +78,8 @@ static int num_write;
 #define NR_READ num_read
 #define NR_WRITE num_write
 
-static cycles_t __attribute__((aligned(CACHE_LINE_SIZE))) *reader_time;
-static cycles_t __attribute__((aligned(CACHE_LINE_SIZE))) *writer_time;
+static cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *reader_time;
+static cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *writer_time;
 
 void *thr_reader(void *arg)
 {
@@ -91,7 +91,7 @@ void *thr_reader(void *arg)
 			"reader", pthread_self(), (unsigned long)gettid());
 	sleep(2);
 
-	time1 = get_cycles();
+	time1 = caa_get_cycles();
 	for (i = 0; i < OUTER_READ_LOOP; i++) {
 		for (j = 0; j < INNER_READ_LOOP; j++) {
 			pthread_mutex_lock(&per_thread_lock[tidx].lock);
@@ -99,7 +99,7 @@ void *thr_reader(void *arg)
 			pthread_mutex_unlock(&per_thread_lock[tidx].lock);
 		}
 	}
-	time2 = get_cycles();
+	time2 = caa_get_cycles();
 
 	reader_time[tidx] = time2 - time1;
 
@@ -122,7 +122,7 @@ void *thr_writer(void *arg)
 
 	for (i = 0; i < OUTER_WRITE_LOOP; i++) {
 		for (j = 0; j < INNER_WRITE_LOOP; j++) {
-			time1 = get_cycles();
+			time1 = caa_get_cycles();
 			for (tidx = 0; tidx < NR_READ; tidx++) {
 				pthread_mutex_lock(&per_thread_lock[tidx].lock);
 			}
@@ -130,7 +130,7 @@ void *thr_writer(void *arg)
 			for (tidx = NR_READ - 1; tidx >= 0; tidx--) {
 				pthread_mutex_unlock(&per_thread_lock[tidx].lock);
 			}
-			time2 = get_cycles();
+			time2 = caa_get_cycles();
 			writer_time[(unsigned long)arg] += time2 - time1;
 			usleep(1);
 		}
diff --git a/tests/test_qsbr.c b/tests/test_qsbr.c
index 4f19c72..1ef8c26 100644
--- a/tests/test_qsbr.c
+++ b/tests/test_qsbr.c
@@ -83,7 +83,7 @@ static unsigned long wduration;
 static inline void loop_sleep(unsigned long l)
 {
 	while(l-- != 0)
-		cpu_relax();
+		caa_cpu_relax();
 }
 
 static int verbose_mode;
diff --git a/tests/test_qsbr_gc.c b/tests/test_qsbr_gc.c
index 875fd36..c9b3f4a 100644
--- a/tests/test_qsbr_gc.c
+++ b/tests/test_qsbr_gc.c
@@ -88,7 +88,7 @@ static unsigned long wduration;
 static inline void loop_sleep(unsigned long l)
 {
 	while(l-- != 0)
-		cpu_relax();
+		caa_cpu_relax();
 }
 
 static int verbose_mode;
@@ -164,7 +164,7 @@ static unsigned int nr_writers;
 
 pthread_mutex_t rcu_copy_mutex = PTHREAD_MUTEX_INITIALIZER;
 static
-unsigned long long __attribute__((aligned(CACHE_LINE_SIZE))) *tot_nr_writes;
+unsigned long long __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *tot_nr_writes;
 
 
 void rcu_copy_mutex_lock(void)
@@ -419,9 +419,9 @@ int main(int argc, char **argv)
 	tot_nr_writes = malloc(sizeof(*tot_nr_writes) * nr_writers);
 	pending_reclaims = malloc(sizeof(*pending_reclaims) * nr_writers);
 	if (reclaim_batch * sizeof(*pending_reclaims[i].queue)
-			< CACHE_LINE_SIZE)
+			< CAA_CACHE_LINE_SIZE)
 		for (i = 0; i < nr_writers; i++)
-			pending_reclaims[i].queue = calloc(1, CACHE_LINE_SIZE);
+			pending_reclaims[i].queue = calloc(1, CAA_CACHE_LINE_SIZE);
 	else
 		for (i = 0; i < nr_writers; i++)
 			pending_reclaims[i].queue = calloc(reclaim_batch,
diff --git a/tests/test_qsbr_timing.c b/tests/test_qsbr_timing.c
index 69193bf..f9f4504 100644
--- a/tests/test_qsbr_timing.c
+++ b/tests/test_qsbr_timing.c
@@ -95,8 +95,8 @@ static int num_write;
 #define NR_READ num_read
 #define NR_WRITE num_write
 
-static cycles_t __attribute__((aligned(CACHE_LINE_SIZE))) *reader_time;
-static cycles_t __attribute__((aligned(CACHE_LINE_SIZE))) *writer_time;
+static cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *reader_time;
+static cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *writer_time;
 
 void *thr_reader(void *arg)
 {
@@ -110,7 +110,7 @@ void *thr_reader(void *arg)
 
 	rcu_register_thread();
 
-	time1 = get_cycles();
+	time1 = caa_get_cycles();
 	for (i = 0; i < OUTER_READ_LOOP; i++) {
 		for (j = 0; j < INNER_READ_LOOP; j++) {
 			_rcu_read_lock();
@@ -122,7 +122,7 @@ void *thr_reader(void *arg)
 		}
 		_rcu_quiescent_state();
 	}
-	time2 = get_cycles();
+	time2 = caa_get_cycles();
 
 	rcu_unregister_thread();
 
@@ -147,7 +147,7 @@ void *thr_writer(void *arg)
 
 	for (i = 0; i < OUTER_WRITE_LOOP; i++) {
 		for (j = 0; j < INNER_WRITE_LOOP; j++) {
-			time1 = get_cycles();
+			time1 = caa_get_cycles();
 			new = malloc(sizeof(struct test_array));
 			rcu_copy_mutex_lock();
 			old = test_rcu_pointer;
@@ -163,7 +163,7 @@ void *thr_writer(void *arg)
 				old->a = 0;
 			}
 			free(old);
-			time2 = get_cycles();
+			time2 = caa_get_cycles();
 			writer_time[(unsigned long)arg] += time2 - time1;
 			usleep(1);
 		}
diff --git a/tests/test_rwlock.c b/tests/test_rwlock.c
index 445ce95..deca53b 100644
--- a/tests/test_rwlock.c
+++ b/tests/test_rwlock.c
@@ -85,7 +85,7 @@ static unsigned long wduration;
 static inline void loop_sleep(unsigned long l)
 {
 	while(l-- != 0)
-		cpu_relax();
+		caa_cpu_relax();
 }
 
 static int verbose_mode;
diff --git a/tests/test_rwlock_timing.c b/tests/test_rwlock_timing.c
index 7d16806..96269c0 100644
--- a/tests/test_rwlock_timing.c
+++ b/tests/test_rwlock_timing.c
@@ -75,8 +75,8 @@ static int num_write;
 #define NR_READ num_read
 #define NR_WRITE num_write
 
-static cycles_t __attribute__((aligned(CACHE_LINE_SIZE))) *reader_time;
-static cycles_t __attribute__((aligned(CACHE_LINE_SIZE))) *writer_time;
+static cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *reader_time;
+static cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *writer_time;
 
 void *thr_reader(void *arg)
 {
@@ -87,7 +87,7 @@ void *thr_reader(void *arg)
 			"reader", pthread_self(), (unsigned long)gettid());
 	sleep(2);
 
-	time1 = get_cycles();
+	time1 = caa_get_cycles();
 	for (i = 0; i < OUTER_READ_LOOP; i++) {
 		for (j = 0; j < INNER_READ_LOOP; j++) {
 			pthread_rwlock_rdlock(&lock);
@@ -95,7 +95,7 @@ void *thr_reader(void *arg)
 			pthread_rwlock_unlock(&lock);
 		}
 	}
-	time2 = get_cycles();
+	time2 = caa_get_cycles();
 
 	reader_time[(unsigned long)arg] = time2 - time1;
 
@@ -117,11 +117,11 @@ void *thr_writer(void *arg)
 
 	for (i = 0; i < OUTER_WRITE_LOOP; i++) {
 		for (j = 0; j < INNER_WRITE_LOOP; j++) {
-			time1 = get_cycles();
+			time1 = caa_get_cycles();
 			pthread_rwlock_wrlock(&lock);
 			test_array.a = 8;
 			pthread_rwlock_unlock(&lock);
-			time2 = get_cycles();
+			time2 = caa_get_cycles();
 			writer_time[(unsigned long)arg] += time2 - time1;
 			usleep(1);
 		}
diff --git a/tests/test_urcu.c b/tests/test_urcu.c
index eeea7f5..e6a6489 100644
--- a/tests/test_urcu.c
+++ b/tests/test_urcu.c
@@ -83,7 +83,7 @@ static unsigned long wduration;
 static inline void loop_sleep(unsigned long l)
 {
 	while(l-- != 0)
-		cpu_relax();
+		caa_cpu_relax();
 }
 
 static int verbose_mode;
diff --git a/tests/test_urcu_assign.c b/tests/test_urcu_assign.c
index 481cdd6..24a704b 100644
--- a/tests/test_urcu_assign.c
+++ b/tests/test_urcu_assign.c
@@ -83,7 +83,7 @@ static unsigned long wduration;
 static inline void loop_sleep(unsigned long l)
 {
 	while(l-- != 0)
-		cpu_relax();
+		caa_cpu_relax();
 }
 
 static int verbose_mode;
diff --git a/tests/test_urcu_bp.c b/tests/test_urcu_bp.c
index e831824..7f20a6a 100644
--- a/tests/test_urcu_bp.c
+++ b/tests/test_urcu_bp.c
@@ -83,7 +83,7 @@ static unsigned long wduration;
 static inline void loop_sleep(unsigned long l)
 {
 	while(l-- != 0)
-		cpu_relax();
+		caa_cpu_relax();
 }
 
 static int verbose_mode;
diff --git a/tests/test_urcu_defer.c b/tests/test_urcu_defer.c
index 2cbb041..c333964 100644
--- a/tests/test_urcu_defer.c
+++ b/tests/test_urcu_defer.c
@@ -84,7 +84,7 @@ static unsigned long wduration;
 static inline void loop_sleep(unsigned long l)
 {
 	while(l-- != 0)
-		cpu_relax();
+		caa_cpu_relax();
 }
 
 static int verbose_mode;
@@ -156,7 +156,7 @@ static unsigned long long __thread nr_writes;
 static unsigned long long __thread nr_reads;
 
 static
-unsigned long long __attribute__((aligned(CACHE_LINE_SIZE))) *tot_nr_writes;
+unsigned long long __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *tot_nr_writes;
 
 static unsigned int nr_readers;
 static unsigned int nr_writers;
diff --git a/tests/test_urcu_gc.c b/tests/test_urcu_gc.c
index ddafb87..d0f7e6e 100644
--- a/tests/test_urcu_gc.c
+++ b/tests/test_urcu_gc.c
@@ -92,7 +92,7 @@ static unsigned long wduration;
 static inline void loop_sleep(unsigned long l)
 {
 	while(l-- != 0)
-		cpu_relax();
+		caa_cpu_relax();
 }
 
 static int verbose_mode;
@@ -164,7 +164,7 @@ static unsigned long long __thread nr_writes;
 static unsigned long long __thread nr_reads;
 
 static
-unsigned long long __attribute__((aligned(CACHE_LINE_SIZE))) *tot_nr_writes;
+unsigned long long __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *tot_nr_writes;
 
 static unsigned int nr_readers;
 static unsigned int nr_writers;
@@ -419,9 +419,9 @@ int main(int argc, char **argv)
 	tot_nr_writes = malloc(sizeof(*tot_nr_writes) * nr_writers);
 	pending_reclaims = malloc(sizeof(*pending_reclaims) * nr_writers);
 	if (reclaim_batch * sizeof(*pending_reclaims[i].queue)
-			< CACHE_LINE_SIZE)
+			< CAA_CACHE_LINE_SIZE)
 		for (i = 0; i < nr_writers; i++)
-			pending_reclaims[i].queue = calloc(1, CACHE_LINE_SIZE);
+			pending_reclaims[i].queue = calloc(1, CAA_CACHE_LINE_SIZE);
 	else
 		for (i = 0; i < nr_writers; i++)
 			pending_reclaims[i].queue = calloc(reclaim_batch,
diff --git a/tests/test_urcu_lfq.c b/tests/test_urcu_lfq.c
index 901bcae..aed9be0 100644
--- a/tests/test_urcu_lfq.c
+++ b/tests/test_urcu_lfq.c
@@ -77,7 +77,7 @@ static unsigned long wdelay;
 static inline void loop_sleep(unsigned long l)
 {
 	while(l-- != 0)
-		cpu_relax();
+		caa_cpu_relax();
 }
 
 static int verbose_mode;
@@ -202,7 +202,7 @@ fail:
 
 static void rcu_release_node(struct urcu_ref *ref)
 {
-	struct rcu_lfq_node *node = container_of(ref, struct rcu_lfq_node, ref);
+	struct rcu_lfq_node *node = caa_container_of(ref, struct rcu_lfq_node, ref);
 	defer_rcu(free, node);
 	//synchronize_rcu();
 	//free(node);
@@ -255,7 +255,7 @@ void *thr_dequeuer(void *_count)
 
 static void release_node(struct urcu_ref *ref)
 {
-	struct rcu_lfq_node *node = container_of(ref, struct rcu_lfq_node, ref);
+	struct rcu_lfq_node *node = caa_container_of(ref, struct rcu_lfq_node, ref);
 	free(node);
 }
 
diff --git a/tests/test_urcu_lfs.c b/tests/test_urcu_lfs.c
index 8249eba..02be2d4 100644
--- a/tests/test_urcu_lfs.c
+++ b/tests/test_urcu_lfs.c
@@ -77,7 +77,7 @@ static unsigned long wdelay;
 static inline void loop_sleep(unsigned long l)
 {
 	while(l-- != 0)
-		cpu_relax();
+		caa_cpu_relax();
 }
 
 static int verbose_mode;
diff --git a/tests/test_urcu_timing.c b/tests/test_urcu_timing.c
index 94ac0ae..8e1a810 100644
--- a/tests/test_urcu_timing.c
+++ b/tests/test_urcu_timing.c
@@ -94,8 +94,8 @@ static int num_write;
 #define NR_READ num_read
 #define NR_WRITE num_write
 
-static cycles_t __attribute__((aligned(CACHE_LINE_SIZE))) *reader_time;
-static cycles_t __attribute__((aligned(CACHE_LINE_SIZE))) *writer_time;
+static cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *reader_time;
+static cycles_t __attribute__((aligned(CAA_CACHE_LINE_SIZE))) *writer_time;
 
 void *thr_reader(void *arg)
 {
@@ -109,7 +109,7 @@ void *thr_reader(void *arg)
 
 	rcu_register_thread();
 
-	time1 = get_cycles();
+	time1 = caa_get_cycles();
 	for (i = 0; i < OUTER_READ_LOOP; i++) {
 		for (j = 0; j < INNER_READ_LOOP; j++) {
 			rcu_read_lock();
@@ -120,7 +120,7 @@ void *thr_reader(void *arg)
 			rcu_read_unlock();
 		}
 	}
-	time2 = get_cycles();
+	time2 = caa_get_cycles();
 
 	rcu_unregister_thread();
 
@@ -145,7 +145,7 @@ void *thr_writer(void *arg)
 
 	for (i = 0; i < OUTER_WRITE_LOOP; i++) {
 		for (j = 0; j < INNER_WRITE_LOOP; j++) {
-			time1 = get_cycles();
+			time1 = caa_get_cycles();
 			new = malloc(sizeof(struct test_array));
 			rcu_copy_mutex_lock();
 			old = test_rcu_pointer;
@@ -161,7 +161,7 @@ void *thr_writer(void *arg)
 				old->a = 0;
 			}
 			free(old);
-			time2 = get_cycles();
+			time2 = caa_get_cycles();
 			writer_time[(unsigned long)arg] += time2 - time1;
 			usleep(1);
 		}
diff --git a/tests/test_urcu_wfq.c b/tests/test_urcu_wfq.c
index d446e47..cb49454 100644
--- a/tests/test_urcu_wfq.c
+++ b/tests/test_urcu_wfq.c
@@ -76,7 +76,7 @@ static unsigned long wdelay;
 static inline void loop_sleep(unsigned long l)
 {
 	while(l-- != 0)
-		cpu_relax();
+		caa_cpu_relax();
 }
 
 static int verbose_mode;
diff --git a/tests/test_urcu_wfs.c b/tests/test_urcu_wfs.c
index 294e955..49f9218 100644
--- a/tests/test_urcu_wfs.c
+++ b/tests/test_urcu_wfs.c
@@ -76,7 +76,7 @@ static unsigned long wdelay;
 static inline void loop_sleep(unsigned long l)
 {
 	while(l-- != 0)
-		cpu_relax();
+		caa_cpu_relax();
 }
 
 static int verbose_mode;
diff --git a/urcu-bp-static.h b/urcu-bp-static.h
index 394476b..ea2c376 100644
--- a/urcu-bp-static.h
+++ b/urcu-bp-static.h
@@ -140,7 +140,7 @@ struct rcu_reader {
 	/* Data used by both reader and synchronize_rcu() */
 	long ctr;
 	/* Data used for registry */
-	struct list_head node __attribute__((aligned(CACHE_LINE_SIZE)));
+	struct list_head node __attribute__((aligned(CAA_CACHE_LINE_SIZE)));
 	pthread_t tid;
 	int alloc;	/* registry entry allocated */
 };
@@ -162,7 +162,7 @@ static inline int rcu_old_gp_ongoing(long *value)
 	 * Make sure both tests below are done on the same version of *value
 	 * to insure consistency.
 	 */
-	v = LOAD_SHARED(*value);
+	v = CAA_LOAD_SHARED(*value);
 	return (v & RCU_GP_CTR_NEST_MASK) &&
 		 ((v ^ rcu_gp_ctr) & RCU_GP_CTR_PHASE);
 }
@@ -182,14 +182,14 @@ static inline void _rcu_read_lock(void)
 	 *   RCU_GP_COUNT | (~RCU_GP_CTR_PHASE or RCU_GP_CTR_PHASE)
 	 */
 	if (likely(!(tmp & RCU_GP_CTR_NEST_MASK))) {
-		_STORE_SHARED(rcu_reader->ctr, _LOAD_SHARED(rcu_gp_ctr));
+		_CAA_STORE_SHARED(rcu_reader->ctr, _CAA_LOAD_SHARED(rcu_gp_ctr));
 		/*
 		 * Set active readers count for outermost nesting level before
 		 * accessing the pointer.
 		 */
 		cmm_smp_mb();
 	} else {
-		_STORE_SHARED(rcu_reader->ctr, tmp + RCU_GP_COUNT);
+		_CAA_STORE_SHARED(rcu_reader->ctr, tmp + RCU_GP_COUNT);
 	}
 }
 
@@ -199,7 +199,7 @@ static inline void _rcu_read_unlock(void)
 	 * Finish using rcu before decrementing the pointer.
 	 */
 	cmm_smp_mb();
-	_STORE_SHARED(rcu_reader->ctr, rcu_reader->ctr - RCU_GP_COUNT);
+	_CAA_STORE_SHARED(rcu_reader->ctr, rcu_reader->ctr - RCU_GP_COUNT);
 	cmm_barrier();	/* Ensure the compiler does not reorder us with mutex */
 }
 
diff --git a/urcu-bp.c b/urcu-bp.c
index 33352c2..b457d2b 100644
--- a/urcu-bp.c
+++ b/urcu-bp.c
@@ -123,13 +123,13 @@ void update_counter_and_wait(void)
 	struct rcu_reader *index, *tmp;
 
 	/* Switch parity: 0 -> 1, 1 -> 0 */
-	STORE_SHARED(rcu_gp_ctr, rcu_gp_ctr ^ RCU_GP_CTR_PHASE);
+	CAA_STORE_SHARED(rcu_gp_ctr, rcu_gp_ctr ^ RCU_GP_CTR_PHASE);
 
 	/*
 	 * Must commit qparity update to memory before waiting for other parity
 	 * quiescent state. Failure to do so could result in the writer waiting
 	 * forever while new readers are always accessing data (no progress).
-	 * Ensured by STORE_SHARED and LOAD_SHARED.
+	 * Ensured by CAA_STORE_SHARED and CAA_LOAD_SHARED.
 	 */
 
 	/*
@@ -155,7 +155,7 @@ void update_counter_and_wait(void)
 			if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS)
 				usleep(RCU_SLEEP_DELAY);
 			else
-				cpu_relax();
+				caa_cpu_relax();
 		}
 	}
 	/* put back the reader list in the registry */
diff --git a/urcu-defer.c b/urcu-defer.c
index 6dc08a3..c28e848 100644
--- a/urcu-defer.c
+++ b/urcu-defer.c
@@ -110,7 +110,7 @@ static unsigned long rcu_defer_num_callbacks(void)
 
 	mutex_lock(&rcu_defer_mutex);
 	list_for_each_entry(index, &registry, list) {
-		head = LOAD_SHARED(index->head);
+		head = CAA_LOAD_SHARED(index->head);
 		num_items += head - index->tail;
 	}
 	mutex_unlock(&rcu_defer_mutex);
@@ -153,21 +153,21 @@ static void rcu_defer_barrier_queue(struct defer_queue *queue,
 
 	for (i = queue->tail; i != head;) {
 		cmm_smp_rmb();       /* read head before q[]. */
-		p = LOAD_SHARED(queue->q[i++ & DEFER_QUEUE_MASK]);
+		p = CAA_LOAD_SHARED(queue->q[i++ & DEFER_QUEUE_MASK]);
 		if (unlikely(DQ_IS_FCT_BIT(p))) {
 			DQ_CLEAR_FCT_BIT(p);
 			queue->last_fct_out = p;
-			p = LOAD_SHARED(queue->q[i++ & DEFER_QUEUE_MASK]);
+			p = CAA_LOAD_SHARED(queue->q[i++ & DEFER_QUEUE_MASK]);
 		} else if (unlikely(p == DQ_FCT_MARK)) {
-			p = LOAD_SHARED(queue->q[i++ & DEFER_QUEUE_MASK]);
+			p = CAA_LOAD_SHARED(queue->q[i++ & DEFER_QUEUE_MASK]);
 			queue->last_fct_out = p;
-			p = LOAD_SHARED(queue->q[i++ & DEFER_QUEUE_MASK]);
+			p = CAA_LOAD_SHARED(queue->q[i++ & DEFER_QUEUE_MASK]);
 		}
 		fct = queue->last_fct_out;
 		fct(p);
 	}
 	cmm_smp_mb();	/* push tail after having used q[] */
-	STORE_SHARED(queue->tail, i);
+	CAA_STORE_SHARED(queue->tail, i);
 }
 
 static void _rcu_defer_barrier_thread(void)
@@ -212,7 +212,7 @@ void rcu_defer_barrier(void)
 
 	mutex_lock(&rcu_defer_mutex);
 	list_for_each_entry(index, &registry, list) {
-		index->last_head = LOAD_SHARED(index->head);
+		index->last_head = CAA_LOAD_SHARED(index->head);
 		num_items += index->last_head - index->tail;
 	}
 	if (likely(!num_items)) {
@@ -241,7 +241,7 @@ void _defer_rcu(void (*fct)(void *p), void *p)
 	 * thread.
 	 */
 	head = defer_queue.head;
-	tail = LOAD_SHARED(defer_queue.tail);
+	tail = CAA_LOAD_SHARED(defer_queue.tail);
 
 	/*
 	 * If queue is full, or reached threshold. Empty queue ourself.
@@ -250,7 +250,7 @@ void _defer_rcu(void (*fct)(void *p), void *p)
 	if (unlikely(head - tail >= DEFER_QUEUE_SIZE - 2)) {
 		assert(head - tail <= DEFER_QUEUE_SIZE);
 		rcu_defer_barrier_thread();
-		assert(head - LOAD_SHARED(defer_queue.tail) == 0);
+		assert(head - CAA_LOAD_SHARED(defer_queue.tail) == 0);
 	}
 
 	if (unlikely(defer_queue.last_fct_in != fct)) {
@@ -261,13 +261,13 @@ void _defer_rcu(void (*fct)(void *p), void *p)
 			 * marker, write DQ_FCT_MARK followed by the function
 			 * pointer.
 			 */
-			_STORE_SHARED(defer_queue.q[head++ & DEFER_QUEUE_MASK],
+			_CAA_STORE_SHARED(defer_queue.q[head++ & DEFER_QUEUE_MASK],
 				      DQ_FCT_MARK);
-			_STORE_SHARED(defer_queue.q[head++ & DEFER_QUEUE_MASK],
+			_CAA_STORE_SHARED(defer_queue.q[head++ & DEFER_QUEUE_MASK],
 				      fct);
 		} else {
 			DQ_SET_FCT_BIT(fct);
-			_STORE_SHARED(defer_queue.q[head++ & DEFER_QUEUE_MASK],
+			_CAA_STORE_SHARED(defer_queue.q[head++ & DEFER_QUEUE_MASK],
 				      fct);
 		}
 	} else {
@@ -276,16 +276,16 @@ void _defer_rcu(void (*fct)(void *p), void *p)
 			 * If the data to encode is not aligned or the marker,
 			 * write DQ_FCT_MARK followed by the function pointer.
 			 */
-			_STORE_SHARED(defer_queue.q[head++ & DEFER_QUEUE_MASK],
+			_CAA_STORE_SHARED(defer_queue.q[head++ & DEFER_QUEUE_MASK],
 				      DQ_FCT_MARK);
-			_STORE_SHARED(defer_queue.q[head++ & DEFER_QUEUE_MASK],
+			_CAA_STORE_SHARED(defer_queue.q[head++ & DEFER_QUEUE_MASK],
 				      fct);
 		}
 	}
-	_STORE_SHARED(defer_queue.q[head++ & DEFER_QUEUE_MASK], p);
+	_CAA_STORE_SHARED(defer_queue.q[head++ & DEFER_QUEUE_MASK], p);
 	cmm_smp_wmb();	/* Publish new pointer before head */
 			/* Write q[] before head. */
-	STORE_SHARED(defer_queue.head, head);
+	CAA_STORE_SHARED(defer_queue.head, head);
 	cmm_smp_mb();	/* Write queue head before read futex */
 	/*
 	 * Wake-up any waiting defer thread.
diff --git a/urcu-pointer-static.h b/urcu-pointer-static.h
index c8ac7f0..5a1e0e4 100644
--- a/urcu-pointer-static.h
+++ b/urcu-pointer-static.h
@@ -49,7 +49,7 @@ extern "C" {
  * Inserts memory barriers on architectures that require them (currently only
  * Alpha) and documents which pointers are protected by RCU.
  *
- * The compiler memory barrier in LOAD_SHARED() ensures that value-speculative
+ * The compiler memory barrier in CAA_LOAD_SHARED() ensures that value-speculative
  * optimizations (e.g. VSS: Value Speculation Scheduling) does not perform the
  * data read before the pointer read by speculating the value of the pointer.
  * Correct ordering is ensured because the pointer is read as a volatile access.
@@ -62,7 +62,7 @@ extern "C" {
  */
 
 #define _rcu_dereference(p)     ({					\
-				typeof(p) _________p1 = LOAD_SHARED(p); \
+				typeof(p) _________p1 = CAA_LOAD_SHARED(p); \
 				cmm_smp_read_barrier_depends();		\
 				(_________p1);				\
 				})
diff --git a/urcu-qsbr-static.h b/urcu-qsbr-static.h
index 108ef6e..ab4dcb5 100644
--- a/urcu-qsbr-static.h
+++ b/urcu-qsbr-static.h
@@ -135,7 +135,7 @@ struct rcu_reader {
 	/* Data used by both reader and synchronize_rcu() */
 	unsigned long ctr;
 	/* Data used for registry */
-	struct list_head node __attribute__((aligned(CACHE_LINE_SIZE)));
+	struct list_head node __attribute__((aligned(CAA_CACHE_LINE_SIZE)));
 	pthread_t tid;
 };
 
@@ -159,7 +159,7 @@ static inline int rcu_gp_ongoing(unsigned long *ctr)
 {
 	unsigned long v;
 
-	v = LOAD_SHARED(*ctr);
+	v = CAA_LOAD_SHARED(*ctr);
 	return v && (v != rcu_gp_ctr);
 }
 
@@ -175,7 +175,7 @@ static inline void _rcu_read_unlock(void)
 static inline void _rcu_quiescent_state(void)
 {
 	cmm_smp_mb();
-	_STORE_SHARED(rcu_reader.ctr, _LOAD_SHARED(rcu_gp_ctr));
+	_CAA_STORE_SHARED(rcu_reader.ctr, _CAA_LOAD_SHARED(rcu_gp_ctr));
 	cmm_smp_mb();	/* write rcu_reader.ctr before read futex */
 	wake_up_gp();
 	cmm_smp_mb();
@@ -184,7 +184,7 @@ static inline void _rcu_quiescent_state(void)
 static inline void _rcu_thread_offline(void)
 {
 	cmm_smp_mb();
-	STORE_SHARED(rcu_reader.ctr, 0);
+	CAA_STORE_SHARED(rcu_reader.ctr, 0);
 	cmm_smp_mb();	/* write rcu_reader.ctr before read futex */
 	wake_up_gp();
 	cmm_barrier();	/* Ensure the compiler does not reorder us with mutex */
@@ -193,7 +193,7 @@ static inline void _rcu_thread_offline(void)
 static inline void _rcu_thread_online(void)
 {
 	cmm_barrier();	/* Ensure the compiler does not reorder us with mutex */
-	_STORE_SHARED(rcu_reader.ctr, LOAD_SHARED(rcu_gp_ctr));
+	_CAA_STORE_SHARED(rcu_reader.ctr, CAA_LOAD_SHARED(rcu_gp_ctr));
 	cmm_smp_mb();
 }
 
diff --git a/urcu-qsbr.c b/urcu-qsbr.c
index 2cf73d5..51d34c7 100644
--- a/urcu-qsbr.c
+++ b/urcu-qsbr.c
@@ -114,10 +114,10 @@ static void update_counter_and_wait(void)
 
 #if (BITS_PER_LONG < 64)
 	/* Switch parity: 0 -> 1, 1 -> 0 */
-	STORE_SHARED(rcu_gp_ctr, rcu_gp_ctr ^ RCU_GP_CTR);
+	CAA_STORE_SHARED(rcu_gp_ctr, rcu_gp_ctr ^ RCU_GP_CTR);
 #else	/* !(BITS_PER_LONG < 64) */
 	/* Increment current G.P. */
-	STORE_SHARED(rcu_gp_ctr, rcu_gp_ctr + RCU_GP_CTR);
+	CAA_STORE_SHARED(rcu_gp_ctr, rcu_gp_ctr + RCU_GP_CTR);
 #endif	/* !(BITS_PER_LONG < 64) */
 
 	/*
@@ -163,7 +163,7 @@ static void update_counter_and_wait(void)
 				wait_gp();
 			} else {
 #ifndef HAS_INCOHERENT_CACHES
-				cpu_relax();
+				caa_cpu_relax();
 #else /* #ifndef HAS_INCOHERENT_CACHES */
 				cmm_smp_mb();
 #endif /* #else #ifndef HAS_INCOHERENT_CACHES */
@@ -198,7 +198,7 @@ void synchronize_rcu(void)
 	 * threads registered as readers.
 	 */
 	if (was_online)
-		STORE_SHARED(rcu_reader.ctr, 0);
+		CAA_STORE_SHARED(rcu_reader.ctr, 0);
 
 	mutex_lock(&rcu_gp_lock);
 
@@ -238,7 +238,7 @@ out:
 	 * freed.
 	 */
 	if (was_online)
-		_STORE_SHARED(rcu_reader.ctr, LOAD_SHARED(rcu_gp_ctr));
+		_CAA_STORE_SHARED(rcu_reader.ctr, CAA_LOAD_SHARED(rcu_gp_ctr));
 	cmm_smp_mb();
 }
 #else /* !(BITS_PER_LONG < 64) */
@@ -255,7 +255,7 @@ void synchronize_rcu(void)
 	 */
 	cmm_smp_mb();
 	if (was_online)
-		STORE_SHARED(rcu_reader.ctr, 0);
+		CAA_STORE_SHARED(rcu_reader.ctr, 0);
 
 	mutex_lock(&rcu_gp_lock);
 	if (list_empty(&registry))
@@ -265,7 +265,7 @@ out:
 	mutex_unlock(&rcu_gp_lock);
 
 	if (was_online)
-		_STORE_SHARED(rcu_reader.ctr, LOAD_SHARED(rcu_gp_ctr));
+		_CAA_STORE_SHARED(rcu_reader.ctr, CAA_LOAD_SHARED(rcu_gp_ctr));
 	cmm_smp_mb();
 }
 #endif  /* !(BITS_PER_LONG < 64) */
diff --git a/urcu-static.h b/urcu-static.h
index ad415ac..46fe64a 100644
--- a/urcu-static.h
+++ b/urcu-static.h
@@ -222,7 +222,7 @@ struct rcu_reader {
 	unsigned long ctr;
 	char need_mb;
 	/* Data used for registry */
-	struct list_head node __attribute__((aligned(CACHE_LINE_SIZE)));
+	struct list_head node __attribute__((aligned(CAA_CACHE_LINE_SIZE)));
 	pthread_t tid;
 };
 
@@ -250,7 +250,7 @@ static inline int rcu_gp_ongoing(unsigned long *ctr)
 	 * Make sure both tests below are done on the same version of *value
 	 * to insure consistency.
 	 */
-	v = LOAD_SHARED(*ctr);
+	v = CAA_LOAD_SHARED(*ctr);
 	return (v & RCU_GP_CTR_NEST_MASK) &&
 		 ((v ^ rcu_gp_ctr) & RCU_GP_CTR_PHASE);
 }
@@ -266,14 +266,14 @@ static inline void _rcu_read_lock(void)
 	 *   RCU_GP_COUNT | (~RCU_GP_CTR_PHASE or RCU_GP_CTR_PHASE)
 	 */
 	if (likely(!(tmp & RCU_GP_CTR_NEST_MASK))) {
-		_STORE_SHARED(rcu_reader.ctr, _LOAD_SHARED(rcu_gp_ctr));
+		_CAA_STORE_SHARED(rcu_reader.ctr, _CAA_LOAD_SHARED(rcu_gp_ctr));
 		/*
 		 * Set active readers count for outermost nesting level before
 		 * accessing the pointer. See smp_mb_master().
 		 */
 		smp_mb_slave(RCU_MB_GROUP);
 	} else {
-		_STORE_SHARED(rcu_reader.ctr, tmp + RCU_GP_COUNT);
+		_CAA_STORE_SHARED(rcu_reader.ctr, tmp + RCU_GP_COUNT);
 	}
 }
 
@@ -288,12 +288,12 @@ static inline void _rcu_read_unlock(void)
 	 */
 	if (likely((tmp & RCU_GP_CTR_NEST_MASK) == RCU_GP_COUNT)) {
 		smp_mb_slave(RCU_MB_GROUP);
-		_STORE_SHARED(rcu_reader.ctr, rcu_reader.ctr - RCU_GP_COUNT);
+		_CAA_STORE_SHARED(rcu_reader.ctr, rcu_reader.ctr - RCU_GP_COUNT);
 		/* write rcu_reader.ctr before read futex */
 		smp_mb_slave(RCU_MB_GROUP);
 		wake_up_gp();
 	} else {
-		_STORE_SHARED(rcu_reader.ctr, rcu_reader.ctr - RCU_GP_COUNT);
+		_CAA_STORE_SHARED(rcu_reader.ctr, rcu_reader.ctr - RCU_GP_COUNT);
 	}
 	cmm_barrier();	/* Ensure the compiler does not reorder us with mutex */
 }
diff --git a/urcu.c b/urcu.c
index 9c556aa..b4a5a7d 100644
--- a/urcu.c
+++ b/urcu.c
@@ -99,9 +99,9 @@ static void mutex_lock(pthread_mutex_t *mutex)
 			perror("Error in pthread mutex lock");
 			exit(-1);
 		}
-		if (LOAD_SHARED(rcu_reader.need_mb)) {
+		if (CAA_LOAD_SHARED(rcu_reader.need_mb)) {
 			cmm_smp_mb();
-			_STORE_SHARED(rcu_reader.need_mb, 0);
+			_CAA_STORE_SHARED(rcu_reader.need_mb, 0);
 			cmm_smp_mb();
 		}
 		poll(NULL,0,10);
@@ -155,7 +155,7 @@ static void force_mb_all_readers(void)
 	 * cache flush is enforced.
 	 */
 	list_for_each_entry(index, &registry, node) {
-		STORE_SHARED(index->need_mb, 1);
+		CAA_STORE_SHARED(index->need_mb, 1);
 		pthread_kill(index->tid, SIGRCU);
 	}
 	/*
@@ -172,7 +172,7 @@ static void force_mb_all_readers(void)
 	 * the Linux Test Project (LTP).
 	 */
 	list_for_each_entry(index, &registry, node) {
-		while (LOAD_SHARED(index->need_mb)) {
+		while (CAA_LOAD_SHARED(index->need_mb)) {
 			pthread_kill(index->tid, SIGRCU);
 			poll(NULL, 0, 1);
 		}
@@ -205,7 +205,7 @@ void update_counter_and_wait(void)
 	struct rcu_reader *index, *tmp;
 
 	/* Switch parity: 0 -> 1, 1 -> 0 */
-	STORE_SHARED(rcu_gp_ctr, rcu_gp_ctr ^ RCU_GP_CTR_PHASE);
+	CAA_STORE_SHARED(rcu_gp_ctr, rcu_gp_ctr ^ RCU_GP_CTR_PHASE);
 
 	/*
 	 * Must commit rcu_gp_ctr update to memory before waiting for quiescent
@@ -251,7 +251,7 @@ void update_counter_and_wait(void)
 			if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS)
 				wait_gp();
 			else
-				cpu_relax();
+				caa_cpu_relax();
 		}
 #else /* #ifndef HAS_INCOHERENT_CACHES */
 		/*
@@ -275,7 +275,7 @@ void update_counter_and_wait(void)
 				wait_loops = 0;
 				break; /* only escape switch */
 			default:
-				cpu_relax();
+				caa_cpu_relax();
 			}
 		}
 #endif /* #else #ifndef HAS_INCOHERENT_CACHES */
@@ -384,7 +384,7 @@ static void sigrcu_handler(int signo, siginfo_t *siginfo, void *context)
 	 * executed on.
 	 */
 	cmm_smp_mb();
-	_STORE_SHARED(rcu_reader.need_mb, 0);
+	_CAA_STORE_SHARED(rcu_reader.need_mb, 0);
 	cmm_smp_mb();
 }
 
diff --git a/urcu/arch_generic.h b/urcu/arch_generic.h
index 25a9f7a..100d3c6 100644
--- a/urcu/arch_generic.h
+++ b/urcu/arch_generic.h
@@ -28,8 +28,8 @@
 extern "C" {
 #endif
 
-#ifndef CACHE_LINE_SIZE
-#define CACHE_LINE_SIZE	64
+#ifndef CAA_CACHE_LINE_SIZE
+#define CAA_CACHE_LINE_SIZE	64
 #endif
 
 #if !defined(cmm_mc) && !defined(cmm_rmc) && !defined(cmm_wmc)
@@ -117,8 +117,8 @@ extern "C" {
 #define cmm_smp_read_barrier_depends()
 #endif
 
-#ifndef cpu_relax
-#define cpu_relax()		cmm_barrier()
+#ifndef caa_cpu_relax
+#define caa_cpu_relax()		cmm_barrier()
 #endif
 
 #ifdef __cplusplus
diff --git a/urcu/arch_ppc.h b/urcu/arch_ppc.h
index 93aed2a..e1a8270 100644
--- a/urcu/arch_ppc.h
+++ b/urcu/arch_ppc.h
@@ -30,7 +30,7 @@ extern "C" {
 #endif 
 
 /* Include size of POWER5+ L3 cache lines: 256 bytes */
-#define CACHE_LINE_SIZE	256
+#define CAA_CACHE_LINE_SIZE	256
 
 #define cmm_mb()    asm volatile("sync":::"memory")
 
diff --git a/urcu/arch_s390.h b/urcu/arch_s390.h
index 8a33e20..8d1483a 100644
--- a/urcu/arch_s390.h
+++ b/urcu/arch_s390.h
@@ -35,7 +35,7 @@
 extern "C" {
 #endif 
 
-#define CACHE_LINE_SIZE	128
+#define CAA_CACHE_LINE_SIZE	128
 
 #define cmm_mb()    __asm__ __volatile__("bcr 15,0" : : : "memory")
 
diff --git a/urcu/arch_sparc64.h b/urcu/arch_sparc64.h
index 39f27c7..0752c4d 100644
--- a/urcu/arch_sparc64.h
+++ b/urcu/arch_sparc64.h
@@ -29,7 +29,7 @@
 extern "C" {
 #endif 
 
-#define CACHE_LINE_SIZE	256
+#define CAA_CACHE_LINE_SIZE	256
 
 /*
  * Inspired from the Linux kernel. Workaround Spitfire bug #51.
diff --git a/urcu/arch_x86.h b/urcu/arch_x86.h
index d0a58e8..20db5cf 100644
--- a/urcu/arch_x86.h
+++ b/urcu/arch_x86.h
@@ -29,7 +29,7 @@
 extern "C" {
 #endif 
 
-#define CACHE_LINE_SIZE	128
+#define CAA_CACHE_LINE_SIZE	128
 
 #ifdef CONFIG_RCU_HAVE_FENCE
 #define cmm_mb()    asm volatile("mfence":::"memory")
@@ -45,7 +45,7 @@ extern "C" {
 #define cmm_wmb()   asm volatile("lock; addl $0,0(%%esp)"::: "memory")
 #endif
 
-#define cpu_relax()	asm volatile("rep; nop" : : : "memory");
+#define caa_cpu_relax()	asm volatile("rep; nop" : : : "memory");
 
 #define rdtscll(val)							  \
 	do {						  		  \
@@ -57,7 +57,7 @@ extern "C" {
 
 typedef unsigned long long cycles_t;
 
-static inline cycles_t get_cycles(void)
+static inline cycles_t caa_get_cycles(void)
 {
         cycles_t ret = 0;
 
diff --git a/urcu/compiler.h b/urcu/compiler.h
index d67e6c5..ca32deb 100644
--- a/urcu/compiler.h
+++ b/urcu/compiler.h
@@ -28,16 +28,16 @@
 /*
  * Instruct the compiler to perform only a single access to a variable
  * (prohibits merging and refetching). The compiler is also forbidden to reorder
- * successive instances of ACCESS_ONCE(), but only when the compiler is aware of
+ * successive instances of CAA_ACCESS_ONCE(), but only when the compiler is aware of
  * particular ordering. Compiler ordering can be ensured, for example, by
- * putting two ACCESS_ONCE() in separate C statements.
+ * putting two CAA_ACCESS_ONCE() in separate C statements.
  *
  * This macro does absolutely -nothing- to prevent the CPU from reordering,
  * merging, or refetching absolutely anything at any time.  Its main intended
  * use is to mediate communication between process-level code and irq/NMI
  * handlers, all running on the same CPU.
  */
-#define ACCESS_ONCE(x)	(*(volatile typeof(x) *)&(x))
+#define CAA_ACCESS_ONCE(x)	(*(volatile typeof(x) *)&(x))
 
 #ifndef max
 #define max(a,b) ((a)>(b)?(a):(b))
@@ -48,14 +48,14 @@
 #endif
 
 #if defined(__SIZEOF_LONG__)
-#define BITS_PER_LONG	(__SIZEOF_LONG__ * 8)
+#define CAA_BITS_PER_LONG	(__SIZEOF_LONG__ * 8)
 #elif defined(_LP64)
-#define BITS_PER_LONG	64
+#define CAA_BITS_PER_LONG	64
 #else
-#define BITS_PER_LONG	32
+#define CAA_BITS_PER_LONG	32
 #endif
 
-#define container_of(ptr, type, member)					\
+#define caa_container_of(ptr, type, member)					\
 	({								\
 		const typeof(((type *)NULL)->member) * __ptr = (ptr);	\
 		(type *)((char *)__ptr - offsetof(type, member));	\
diff --git a/urcu/system.h b/urcu/system.h
index 11a499e..e018606 100644
--- a/urcu/system.h
+++ b/urcu/system.h
@@ -24,29 +24,29 @@
 /*
  * Identify a shared load. A cmm_smp_rmc() or cmm_smp_mc() should come before the load.
  */
-#define _LOAD_SHARED(p)	       ACCESS_ONCE(p)
+#define _CAA_LOAD_SHARED(p)	       CAA_ACCESS_ONCE(p)
 
 /*
  * Load a data from shared memory, doing a cache flush if required.
  */
-#define LOAD_SHARED(p)			\
+#define CAA_LOAD_SHARED(p)			\
 	({				\
 		cmm_smp_rmc();		\
-		_LOAD_SHARED(p);	\
+		_CAA_LOAD_SHARED(p);	\
 	})
 
 /*
  * Identify a shared store. A cmm_smp_wmc() or cmm_smp_mc() should follow the store.
  */
-#define _STORE_SHARED(x, v)	({ ACCESS_ONCE(x) = (v); })
+#define _CAA_STORE_SHARED(x, v)	({ CAA_ACCESS_ONCE(x) = (v); })
 
 /*
  * Store v into x, where x is located in shared memory. Performs the required
  * cache flush after writing. Returns v.
  */
-#define STORE_SHARED(x, v)		\
+#define CAA_STORE_SHARED(x, v)		\
 	({				\
-		typeof(x) _v = _STORE_SHARED(x, v);	\
+		typeof(x) _v = _CAA_STORE_SHARED(x, v);	\
 		cmm_smp_wmc();		\
 		_v;			\
 	})
diff --git a/urcu/uatomic_arch_x86.h b/urcu/uatomic_arch_x86.h
index 043e616..4e09afd 100644
--- a/urcu/uatomic_arch_x86.h
+++ b/urcu/uatomic_arch_x86.h
@@ -39,7 +39,7 @@ struct __uatomic_dummy {
 };
 #define __hp(x)	((struct __uatomic_dummy *)(x))
 
-#define _uatomic_set(addr, v)	STORE_SHARED(*(addr), (v))
+#define _uatomic_set(addr, v)	CAA_STORE_SHARED(*(addr), (v))
 
 /* cmpxchg */
 
diff --git a/urcu/uatomic_generic.h b/urcu/uatomic_generic.h
index f65b398..6b4ef9e 100644
--- a/urcu/uatomic_generic.h
+++ b/urcu/uatomic_generic.h
@@ -29,11 +29,11 @@ extern "C" {
 #endif
 
 #ifndef uatomic_set
-#define uatomic_set(addr, v)	STORE_SHARED(*(addr), (v))
+#define uatomic_set(addr, v)	CAA_STORE_SHARED(*(addr), (v))
 #endif
 
 #ifndef uatomic_read
-#define uatomic_read(addr)	LOAD_SHARED(*(addr))
+#define uatomic_read(addr)	CAA_LOAD_SHARED(*(addr))
 #endif
 
 #if !defined __OPTIMIZE__  || defined UATOMIC_NO_LINK_ERROR
diff --git a/urcu/wfqueue-static.h b/urcu/wfqueue-static.h
index 0f7e68f..d0db3fc 100644
--- a/urcu/wfqueue-static.h
+++ b/urcu/wfqueue-static.h
@@ -79,7 +79,7 @@ void _wfq_enqueue(struct wfq_queue *q, struct wfq_node *node)
 	 * that the queue is being appended to. The following store will append
 	 * "node" to the queue from a dequeuer perspective.
 	 */
-	STORE_SHARED(*old_tail, node);
+	CAA_STORE_SHARED(*old_tail, node);
 }
 
 /*
@@ -99,19 +99,19 @@ ___wfq_dequeue_blocking(struct wfq_queue *q)
 	/*
 	 * Queue is empty if it only contains the dummy node.
 	 */
-	if (q->head == &q->dummy && LOAD_SHARED(q->tail) == &q->dummy.next)
+	if (q->head == &q->dummy && CAA_LOAD_SHARED(q->tail) == &q->dummy.next)
 		return NULL;
 	node = q->head;
 
 	/*
 	 * Adaptative busy-looping waiting for enqueuer to complete enqueue.
 	 */
-	while ((next = LOAD_SHARED(node->next)) == NULL) {
+	while ((next = CAA_LOAD_SHARED(node->next)) == NULL) {
 		if (++attempt >= WFQ_ADAPT_ATTEMPTS) {
 			poll(NULL, 0, WFQ_WAIT);	/* Wait for 10ms */
 			attempt = 0;
 		} else
-			cpu_relax();
+			caa_cpu_relax();
 	}
 	/*
 	 * Move queue head forward.
diff --git a/urcu/wfstack-static.h b/urcu/wfstack-static.h
index 3f44743..0acb4f0 100644
--- a/urcu/wfstack-static.h
+++ b/urcu/wfstack-static.h
@@ -67,7 +67,7 @@ void _wfs_push(struct wfs_stack *s, struct wfs_node *node)
 	 * At this point, dequeuers see a NULL node->next, they should busy-wait
 	 * until node->next is set to old_head.
 	 */
-	STORE_SHARED(node->next, old_head);
+	CAA_STORE_SHARED(node->next, old_head);
 }
 
 /*
@@ -80,18 +80,18 @@ ___wfs_pop_blocking(struct wfs_stack *s)
 	int attempt = 0;
 
 retry:
-	head = LOAD_SHARED(s->head);
+	head = CAA_LOAD_SHARED(s->head);
 	if (head == WF_STACK_END)
 		return NULL;
 	/*
 	 * Adaptative busy-looping waiting for push to complete.
 	 */
-	while ((next = LOAD_SHARED(head->next)) == NULL) {
+	while ((next = CAA_LOAD_SHARED(head->next)) == NULL) {
 		if (++attempt >= WFS_ADAPT_ATTEMPTS) {
 			poll(NULL, 0, WFS_WAIT);	/* Wait for 10ms */
 			attempt = 0;
 		} else
-			cpu_relax();
+			caa_cpu_relax();
 	}
 	if (uatomic_cmpxchg(&s->head, head, next) == head)
 		return head;
-- 
1.7.3.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ltt-dev] [URCU PATCH 3/3] Rename all data structure with prefix cds_
  2010-11-18 20:31 [ltt-dev] [URCU PATCH 1/3] Rename all memory primitives with prefix cmm_ David Goulet
  2010-11-18 20:31 ` [ltt-dev] [URCU PATCH 2/3] Rename all arch primitives with prefix caa_ David Goulet
@ 2010-11-18 20:31 ` David Goulet
  2010-11-18 20:57 ` [ltt-dev] [URCU PATCH 1/3] Rename all memory primitives with prefix cmm_ Mathieu Desnoyers
  2 siblings, 0 replies; 4+ messages in thread
From: David Goulet @ 2010-11-18 20:31 UTC (permalink / raw)


This is the third and last patch of the namespace refactoring.

The prefix cds_ stands for Concurrent Data Structure and is
use for queue, list, hlist and stack.

For RCU protected data strucutre, the prefix is also added but
the suffix _rcu is appended. This suffix indicate and RCU protection.

Signed-off-by: David Goulet <david.goulet at polymtl.ca>
---
 rculfqueue.c             |   18 +-
 rculfstack.c             |   16 +-
 tests/api_gcc.h          |  398 +++++++++++++++++++++++-----------------------
 tests/api_ppc.h          |  398 +++++++++++++++++++++++-----------------------
 tests/api_x86.h          |  398 +++++++++++++++++++++++-----------------------
 tests/test_urcu_lfq.c    |   22 ++--
 tests/test_urcu_lfs.c    |   18 +-
 tests/test_urcu_wfq.c    |   18 +-
 tests/test_urcu_wfs.c    |   18 +-
 urcu-bp-static.h         |    2 +-
 urcu-bp.c                |   18 +-
 urcu-defer-static.h      |    2 +-
 urcu-defer.c             |   20 ++--
 urcu-qsbr-static.h       |    2 +-
 urcu-qsbr.c              |   22 ++--
 urcu-static.h            |    2 +-
 urcu.c                   |   28 ++--
 urcu/hlist.h             |   34 ++--
 urcu/list.h              |   70 ++++----
 urcu/rcuhlist.h          |   14 +-
 urcu/rculfqueue-static.h |   18 +-
 urcu/rculfqueue.h        |   30 ++--
 urcu/rculfstack-static.h |   20 ++--
 urcu/rculfstack.h        |   26 ++--
 urcu/rculist.h           |   14 +-
 urcu/wfqueue-static.h    |   30 ++--
 urcu/wfqueue.h           |   32 ++--
 urcu/wfstack-static.h    |   36 ++--
 urcu/wfstack.h           |   30 ++--
 wfqueue.c                |   20 ++--
 wfstack.c                |   20 ++--
 31 files changed, 897 insertions(+), 897 deletions(-)

diff --git a/rculfqueue.c b/rculfqueue.c
index 85c7b88..508e05c 100644
--- a/rculfqueue.c
+++ b/rculfqueue.c
@@ -30,23 +30,23 @@
  * library wrappers to be used by non-LGPL compatible source code.
  */
 
-void rcu_lfq_node_init(struct rcu_lfq_node *node)
+void cds_lfq_node_init_rcu(struct cds_lfq_node_rcu *node)
 {
-	_rcu_lfq_node_init(node);
+	_cds_lfq_node_init_rcu(node);
 }
 
-void rcu_lfq_init(struct rcu_lfq_queue *q)
+void cds_lfq_init_rcu(struct cds_lfq_queue_rcu *q)
 {
-	_rcu_lfq_init(q);
+	_cds_lfq_init_rcu(q);
 }
 
-void rcu_lfq_enqueue(struct rcu_lfq_queue *q, struct rcu_lfq_node *node)
+void cds_lfq_enqueue_rcu(struct cds_lfq_queue_rcu *q, struct cds_lfq_node_rcu *node)
 {
-	_rcu_lfq_enqueue(q, node);
+	_cds_lfq_enqueue_rcu(q, node);
 }
 
-struct rcu_lfq_node *
-rcu_lfq_dequeue(struct rcu_lfq_queue *q, void (*release)(struct urcu_ref *))
+struct cds_lfq_node_rcu *
+cds_lfq_dequeue_rcu(struct cds_lfq_queue_rcu *q, void (*release)(struct urcu_ref *))
 {
-	return _rcu_lfq_dequeue(q, release);
+	return _cds_lfq_dequeue_rcu(q, release);
 }
diff --git a/rculfstack.c b/rculfstack.c
index 01d549b..2c26046 100644
--- a/rculfstack.c
+++ b/rculfstack.c
@@ -31,22 +31,22 @@
  */
 
 
-void rcu_lfs_node_init(struct rcu_lfs_node *node)
+void cds_lfs_node_init_rcu(struct cds_lfs_node_rcu *node)
 {
-	_rcu_lfs_node_init(node);
+	_cds_lfs_node_init_rcu(node);
 }
 
-void rcu_lfs_init(struct rcu_lfs_stack *s)
+void cds_lfs_init_rcu(struct cds_lfs_stack_rcu *s)
 {
-	_rcu_lfs_init(s);
+	_cds_lfs_init_rcu(s);
 }
 
-void rcu_lfs_push(struct rcu_lfs_stack *s, struct rcu_lfs_node *node)
+void cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s, struct cds_lfs_node_rcu *node)
 {
-	_rcu_lfs_push(s, node);
+	_cds_lfs_push_rcu(s, node);
 }
 
-struct rcu_lfs_node *rcu_lfs_pop(struct rcu_lfs_stack *s)
+struct cds_lfs_node_rcu *cds_lfs_pop_rcu(struct cds_lfs_stack_rcu *s)
 {
-	return _rcu_lfs_pop(s);
+	return _cds_lfs_pop_rcu(s);
 }
diff --git a/tests/api_gcc.h b/tests/api_gcc.h
index 632bdd5..2db1ef2 100644
--- a/tests/api_gcc.h
+++ b/tests/api_gcc.h
@@ -656,16 +656,16 @@ static void smp_init(void)
  * using the generic single-entry routines.
  */
 
-struct list_head {
-	struct list_head *next, *prev;
+struct cds_list_head {
+	struct cds_list_head *next, *prev;
 };
 
-#define LIST_HEAD_INIT(name) { &(name), &(name) }
+#define CDS_LIST_HEAD_INIT(name) { &(name), &(name) }
 
-#define LIST_HEAD(name) \
-	struct list_head name = LIST_HEAD_INIT(name)
+#define CDS_LIST_HEAD(name) \
+	struct cds_list_head name = CDS_LIST_HEAD_INIT(name)
 
-static inline void INIT_LIST_HEAD(struct list_head *list)
+static inline void CDS_INIT_LIST_HEAD(struct cds_list_head *list)
 {
 	list->next = list;
 	list->prev = list;
@@ -678,9 +678,9 @@ static inline void INIT_LIST_HEAD(struct list_head *list)
  * the prev/next entries already!
  */
 #ifndef CONFIG_DEBUG_LIST
-static inline void __list_add(struct list_head *new,
-			      struct list_head *prev,
-			      struct list_head *next)
+static inline void __cds_list_add(struct cds_list_head *new,
+			      struct cds_list_head *prev,
+			      struct cds_list_head *next)
 {
 	next->prev = new;
 	new->next = next;
@@ -688,36 +688,36 @@ static inline void __list_add(struct list_head *new,
 	prev->next = new;
 }
 #else
-extern void __list_add(struct list_head *new,
-			      struct list_head *prev,
-			      struct list_head *next);
+extern void __cds_list_add(struct cds_list_head *new,
+			      struct cds_list_head *prev,
+			      struct cds_list_head *next);
 #endif
 
 /**
- * list_add - add a new entry
+ * cds_list_add - add a new entry
  * @new: new entry to be added
  * @head: list head to add it after
  *
  * Insert a new entry after the specified head.
  * This is good for implementing stacks.
  */
-static inline void list_add(struct list_head *new, struct list_head *head)
+static inline void cds_list_add(struct cds_list_head *new, struct cds_list_head *head)
 {
-	__list_add(new, head, head->next);
+	__cds_list_add(new, head, head->next);
 }
 
 
 /**
- * list_add_tail - add a new entry
+ * cds_list_add_tail - add a new entry
  * @new: new entry to be added
  * @head: list head to add it before
  *
  * Insert a new entry before the specified head.
  * This is useful for implementing queues.
  */
-static inline void list_add_tail(struct list_head *new, struct list_head *head)
+static inline void cds_list_add_tail(struct cds_list_head *new, struct cds_list_head *head)
 {
-	__list_add(new, head->prev, head);
+	__cds_list_add(new, head->prev, head);
 }
 
 /*
@@ -727,38 +727,38 @@ static inline void list_add_tail(struct list_head *new, struct list_head *head)
  * This is only for internal list manipulation where we know
  * the prev/next entries already!
  */
-static inline void __list_del(struct list_head * prev, struct list_head * next)
+static inline void __cds_list_del(struct cds_list_head * prev, struct cds_list_head * next)
 {
 	next->prev = prev;
 	prev->next = next;
 }
 
 /**
- * list_del - deletes entry from list.
+ * cds_list_del - deletes entry from list.
  * @entry: the element to delete from the list.
- * Note: list_empty() on entry does not return true after this, the entry is
+ * Note: cds_list_empty() on entry does not return true after this, the entry is
  * in an undefined state.
  */
 #ifndef CONFIG_DEBUG_LIST
-static inline void list_del(struct list_head *entry)
+static inline void cds_list_del(struct cds_list_head *entry)
 {
-	__list_del(entry->prev, entry->next);
+	__cds_list_del(entry->prev, entry->next);
 	entry->next = LIST_POISON1;
 	entry->prev = LIST_POISON2;
 }
 #else
-extern void list_del(struct list_head *entry);
+extern void cds_list_del(struct cds_list_head *entry);
 #endif
 
 /**
- * list_replace - replace old entry by new one
+ * cds_list_replace - replace old entry by new one
  * @old : the element to be replaced
  * @new : the new element to insert
  *
  * If @old was empty, it will be overwritten.
  */
-static inline void list_replace(struct list_head *old,
-				struct list_head *new)
+static inline void cds_list_replace(struct cds_list_head *old,
+				struct cds_list_head *new)
 {
 	new->next = old->next;
 	new->next->prev = new;
@@ -766,44 +766,44 @@ static inline void list_replace(struct list_head *old,
 	new->prev->next = new;
 }
 
-static inline void list_replace_init(struct list_head *old,
-					struct list_head *new)
+static inline void cds_list_replace_init(struct cds_list_head *old,
+					struct cds_list_head *new)
 {
-	list_replace(old, new);
-	INIT_LIST_HEAD(old);
+	cds_list_replace(old, new);
+	CDS_INIT_LIST_HEAD(old);
 }
 
 /**
- * list_del_init - deletes entry from list and reinitialize it.
+ * cds_list_del_init - deletes entry from list and reinitialize it.
  * @entry: the element to delete from the list.
  */
-static inline void list_del_init(struct list_head *entry)
+static inline void cds_list_del_init(struct cds_list_head *entry)
 {
-	__list_del(entry->prev, entry->next);
-	INIT_LIST_HEAD(entry);
+	__cds_list_del(entry->prev, entry->next);
+	CDS_INIT_LIST_HEAD(entry);
 }
 
 /**
- * list_move - delete from one list and add as another's head
+ * cds_list_move - delete from one list and add as another's head
  * @list: the entry to move
  * @head: the head that will precede our entry
  */
-static inline void list_move(struct list_head *list, struct list_head *head)
+static inline void cds_list_move(struct cds_list_head *list, struct cds_list_head *head)
 {
-	__list_del(list->prev, list->next);
-	list_add(list, head);
+	__cds_list_del(list->prev, list->next);
+	cds_list_add(list, head);
 }
 
 /**
- * list_move_tail - delete from one list and add as another's tail
+ * cds_list_move_tail - delete from one list and add as another's tail
  * @list: the entry to move
  * @head: the head that will follow our entry
  */
-static inline void list_move_tail(struct list_head *list,
-				  struct list_head *head)
+static inline void cds_list_move_tail(struct cds_list_head *list,
+				  struct cds_list_head *head)
 {
-	__list_del(list->prev, list->next);
-	list_add_tail(list, head);
+	__cds_list_del(list->prev, list->next);
+	cds_list_add_tail(list, head);
 }
 
 /**
@@ -811,37 +811,37 @@ static inline void list_move_tail(struct list_head *list,
  * @list: the entry to test
  * @head: the head of the list
  */
-static inline int list_is_last(const struct list_head *list,
-				const struct list_head *head)
+static inline int list_is_last(const struct cds_list_head *list,
+				const struct cds_list_head *head)
 {
 	return list->next == head;
 }
 
 /**
- * list_empty - tests whether a list is empty
+ * cds_list_empty - tests whether a list is empty
  * @head: the list to test.
  */
-static inline int list_empty(const struct list_head *head)
+static inline int cds_list_empty(const struct cds_list_head *head)
 {
 	return head->next == head;
 }
 
 /**
- * list_empty_careful - tests whether a list is empty and not being modified
+ * cds_list_empty_careful - tests whether a list is empty and not being modified
  * @head: the list to test
  *
  * Description:
  * tests whether a list is empty _and_ checks that no other CPU might be
  * in the process of modifying either member (next or prev)
  *
- * NOTE: using list_empty_careful() without synchronization
+ * NOTE: using cds_list_empty_careful() without synchronization
  * can only be safe if the only activity that can happen
- * to the list entry is list_del_init(). Eg. it cannot be used
+ * to the list entry is cds_list_del_init(). Eg. it cannot be used
  * if another CPU could re-list_add() it.
  */
-static inline int list_empty_careful(const struct list_head *head)
+static inline int cds_list_empty_careful(const struct cds_list_head *head)
 {
-	struct list_head *next = head->next;
+	struct cds_list_head *next = head->next;
 	return (next == head) && (next == head->prev);
 }
 
@@ -849,15 +849,15 @@ static inline int list_empty_careful(const struct list_head *head)
  * list_is_singular - tests whether a list has just one entry.
  * @head: the list to test.
  */
-static inline int list_is_singular(const struct list_head *head)
+static inline int list_is_singular(const struct cds_list_head *head)
 {
 	return !list_empty(head) && (head->next == head->prev);
 }
 
-static inline void __list_cut_position(struct list_head *list,
-		struct list_head *head, struct list_head *entry)
+static inline void __list_cut_position(struct cds_list_head *list,
+		struct cds_list_head *head, struct cds_list_head *entry)
 {
-	struct list_head *new_first = entry->next;
+	struct cds_list_head *new_first = entry->next;
 	list->next = head->next;
 	list->next->prev = list;
 	list->prev = entry;
@@ -880,26 +880,26 @@ static inline void __list_cut_position(struct list_head *list,
  * losing its data.
  *
  */
-static inline void list_cut_position(struct list_head *list,
-		struct list_head *head, struct list_head *entry)
+static inline void list_cut_position(struct cds_list_head *list,
+		struct cds_list_head *head, struct cds_list_head *entry)
 {
-	if (list_empty(head))
+	if (cds_list_empty(head))
 		return;
 	if (list_is_singular(head) &&
 		(head->next != entry && head != entry))
 		return;
 	if (entry == head)
-		INIT_LIST_HEAD(list);
+		CDS_INIT_LIST_HEAD(list);
 	else
 		__list_cut_position(list, head, entry);
 }
 
-static inline void __list_splice(const struct list_head *list,
-				 struct list_head *prev,
-				 struct list_head *next)
+static inline void __cds_list_splice(const struct cds_list_head *list,
+				 struct cds_list_head *prev,
+				 struct cds_list_head *next)
 {
-	struct list_head *first = list->next;
-	struct list_head *last = list->prev;
+	struct cds_list_head *first = list->next;
+	struct cds_list_head *last = list->prev;
 
 	first->prev = prev;
 	prev->next = first;
@@ -909,69 +909,69 @@ static inline void __list_splice(const struct list_head *list,
 }
 
 /**
- * list_splice - join two lists, this is designed for stacks
+ * cds_list_splice - join two lists, this is designed for stacks
  * @list: the new list to add.
  * @head: the place to add it in the first list.
  */
-static inline void list_splice(const struct list_head *list,
-				struct list_head *head)
+static inline void cds_list_splice(const struct cds_list_head *list,
+				struct cds_list_head *head)
 {
-	if (!list_empty(list))
-		__list_splice(list, head, head->next);
+	if (!cds_list_empty(list))
+		__cds_list_splice(list, head, head->next);
 }
 
 /**
- * list_splice_tail - join two lists, each list being a queue
+ * cds_list_splice_tail - join two lists, each list being a queue
  * @list: the new list to add.
  * @head: the place to add it in the first list.
  */
-static inline void list_splice_tail(struct list_head *list,
-				struct list_head *head)
+static inline void cds_list_splice_tail(struct cds_list_head *list,
+				struct cds_list_head *head)
 {
-	if (!list_empty(list))
-		__list_splice(list, head->prev, head);
+	if (!cds_list_empty(list))
+		__cds_list_splice(list, head->prev, head);
 }
 
 /**
- * list_splice_init - join two lists and reinitialise the emptied list.
+ * cds_list_splice_init - join two lists and reinitialise the emptied list.
  * @list: the new list to add.
  * @head: the place to add it in the first list.
  *
  * The list at @list is reinitialised
  */
-static inline void list_splice_init(struct list_head *list,
-				    struct list_head *head)
+static inline void cds_list_splice_init(struct cds_list_head *list,
+				    struct cds_list_head *head)
 {
-	if (!list_empty(list)) {
-		__list_splice(list, head, head->next);
-		INIT_LIST_HEAD(list);
+	if (!cds_list_empty(list)) {
+		__cds_list_splice(list, head, head->next);
+		CDS_INIT_LIST_HEAD(list);
 	}
 }
 
 /**
- * list_splice_tail_init - join two lists and reinitialise the emptied list
+ * cds_list_splice_tail_init - join two lists and reinitialise the emptied list
  * @list: the new list to add.
  * @head: the place to add it in the first list.
  *
  * Each of the lists is a queue.
  * The list at @list is reinitialised
  */
-static inline void list_splice_tail_init(struct list_head *list,
-					 struct list_head *head)
+static inline void cds_list_splice_tail_init(struct cds_list_head *list,
+					 struct cds_list_head *head)
 {
-	if (!list_empty(list)) {
-		__list_splice(list, head->prev, head);
-		INIT_LIST_HEAD(list);
+	if (!cds_list_empty(list)) {
+		__cds_list_splice(list, head->prev, head);
+		CDS_INIT_LIST_HEAD(list);
 	}
 }
 
 /**
- * list_entry - get the struct for this entry
- * @ptr:	the &struct list_head pointer.
+ * cds_list_entry - get the struct for this entry
+ * @ptr:	the &struct cds_list_head pointer.
  * @type:	the type of the struct this is embedded in.
  * @member:	the name of the list_struct within the struct.
  */
-#define list_entry(ptr, type, member) \
+#define cds_list_entry(ptr, type, member) \
 	caa_container_of(ptr, type, member)
 
 /**
@@ -983,95 +983,95 @@ static inline void list_splice_tail_init(struct list_head *list,
  * Note, that list is expected to be not empty.
  */
 #define list_first_entry(ptr, type, member) \
-	list_entry((ptr)->next, type, member)
+	cds_list_entry((ptr)->next, type, member)
 
 /**
- * list_for_each	-	iterate over a list
- * @pos:	the &struct list_head to use as a loop cursor.
+ * cds_list_for_each	-	iterate over a list
+ * @pos:	the &struct cds_list_head to use as a loop cursor.
  * @head:	the head for your list.
  */
-#define list_for_each(pos, head) \
+#define cds_list_for_each(pos, head) \
 	for (pos = (head)->next; prefetch(pos->next), pos != (head); \
         	pos = pos->next)
 
 /**
- * __list_for_each	-	iterate over a list
- * @pos:	the &struct list_head to use as a loop cursor.
+ * __cds_list_for_each	-	iterate over a list
+ * @pos:	the &struct cds_list_head to use as a loop cursor.
  * @head:	the head for your list.
  *
- * This variant differs from list_for_each() in that it's the
+ * This variant differs from cds_list_for_each() in that it's the
  * simplest possible list iteration code, no prefetching is done.
  * Use this for code that knows the list to be very short (empty
  * or 1 entry) most of the time.
  */
-#define __list_for_each(pos, head) \
+#define __cds_list_for_each(pos, head) \
 	for (pos = (head)->next; pos != (head); pos = pos->next)
 
 /**
- * list_for_each_prev	-	iterate over a list backwards
- * @pos:	the &struct list_head to use as a loop cursor.
+ * cds_list_for_each_prev	-	iterate over a list backwards
+ * @pos:	the &struct cds_list_head to use as a loop cursor.
  * @head:	the head for your list.
  */
-#define list_for_each_prev(pos, head) \
+#define cds_list_for_each_prev(pos, head) \
 	for (pos = (head)->prev; prefetch(pos->prev), pos != (head); \
         	pos = pos->prev)
 
 /**
- * list_for_each_safe - iterate over a list safe against removal of list entry
- * @pos:	the &struct list_head to use as a loop cursor.
- * @n:		another &struct list_head to use as temporary storage
+ * cds_list_for_each_safe - iterate over a list safe against removal of list entry
+ * @pos:	the &struct cds_list_head to use as a loop cursor.
+ * @n:		another &struct cds_list_head to use as temporary storage
  * @head:	the head for your list.
  */
-#define list_for_each_safe(pos, n, head) \
+#define cds_list_for_each_safe(pos, n, head) \
 	for (pos = (head)->next, n = pos->next; pos != (head); \
 		pos = n, n = pos->next)
 
 /**
- * list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
- * @pos:	the &struct list_head to use as a loop cursor.
- * @n:		another &struct list_head to use as temporary storage
+ * cds_list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
+ * @pos:	the &struct cds_list_head to use as a loop cursor.
+ * @n:		another &struct cds_list_head to use as temporary storage
  * @head:	the head for your list.
  */
-#define list_for_each_prev_safe(pos, n, head) \
+#define cds_list_for_each_prev_safe(pos, n, head) \
 	for (pos = (head)->prev, n = pos->prev; \
 	     prefetch(pos->prev), pos != (head); \
 	     pos = n, n = pos->prev)
 
 /**
- * list_for_each_entry	-	iterate over list of given type
+ * cds_list_for_each_entry	-	iterate over list of given type
  * @pos:	the type * to use as a loop cursor.
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
  */
-#define list_for_each_entry(pos, head, member)				\
-	for (pos = list_entry((head)->next, typeof(*pos), member);	\
+#define cds_list_for_each_entry(pos, head, member)				\
+	for (pos = cds_list_entry((head)->next, typeof(*pos), member);	\
 	     prefetch(pos->member.next), &pos->member != (head); 	\
-	     pos = list_entry(pos->member.next, typeof(*pos), member))
+	     pos = cds_list_entry(pos->member.next, typeof(*pos), member))
 
 /**
- * list_for_each_entry_reverse - iterate backwards over list of given type.
+ * cds_list_for_each_entry_reverse - iterate backwards over list of given type.
  * @pos:	the type * to use as a loop cursor.
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
  */
-#define list_for_each_entry_reverse(pos, head, member)			\
-	for (pos = list_entry((head)->prev, typeof(*pos), member);	\
+#define cds_list_for_each_entry_reverse(pos, head, member)			\
+	for (pos = cds_list_entry((head)->prev, typeof(*pos), member);	\
 	     prefetch(pos->member.prev), &pos->member != (head); 	\
-	     pos = list_entry(pos->member.prev, typeof(*pos), member))
+	     pos = cds_list_entry(pos->member.prev, typeof(*pos), member))
 
 /**
- * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue()
+ * list_prepare_entry - prepare a pos entry for use in cds_list_for_each_entry_continue()
  * @pos:	the type * to use as a start point
  * @head:	the head of the list
  * @member:	the name of the list_struct within the struct.
  *
- * Prepares a pos entry for use as a start point in list_for_each_entry_continue().
+ * Prepares a pos entry for use as a start point in cds_list_for_each_entry_continue().
  */
 #define list_prepare_entry(pos, head, member) \
-	((pos) ? : list_entry(head, typeof(*pos), member))
+	((pos) ? : cds_list_entry(head, typeof(*pos), member))
 
 /**
- * list_for_each_entry_continue - continue iteration over list of given type
+ * cds_list_for_each_entry_continue - continue iteration over list of given type
  * @pos:	the type * to use as a loop cursor.
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
@@ -1079,13 +1079,13 @@ static inline void list_splice_tail_init(struct list_head *list,
  * Continue to iterate over list of given type, continuing after
  * the current position.
  */
-#define list_for_each_entry_continue(pos, head, member) 		\
-	for (pos = list_entry(pos->member.next, typeof(*pos), member);	\
+#define cds_list_for_each_entry_continue(pos, head, member) 		\
+	for (pos = cds_list_entry(pos->member.next, typeof(*pos), member);	\
 	     prefetch(pos->member.next), &pos->member != (head);	\
-	     pos = list_entry(pos->member.next, typeof(*pos), member))
+	     pos = cds_list_entry(pos->member.next, typeof(*pos), member))
 
 /**
- * list_for_each_entry_continue_reverse - iterate backwards from the given point
+ * cds_list_for_each_entry_continue_reverse - iterate backwards from the given point
  * @pos:	the type * to use as a loop cursor.
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
@@ -1093,38 +1093,38 @@ static inline void list_splice_tail_init(struct list_head *list,
  * Start to iterate over list of given type backwards, continuing after
  * the current position.
  */
-#define list_for_each_entry_continue_reverse(pos, head, member)		\
-	for (pos = list_entry(pos->member.prev, typeof(*pos), member);	\
+#define cds_list_for_each_entry_continue_reverse(pos, head, member)		\
+	for (pos = cds_list_entry(pos->member.prev, typeof(*pos), member);	\
 	     prefetch(pos->member.prev), &pos->member != (head);	\
-	     pos = list_entry(pos->member.prev, typeof(*pos), member))
+	     pos = cds_list_entry(pos->member.prev, typeof(*pos), member))
 
 /**
- * list_for_each_entry_from - iterate over list of given type from the current point
+ * cds_list_for_each_entry_from - iterate over list of given type from the current point
  * @pos:	the type * to use as a loop cursor.
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
  *
  * Iterate over list of given type, continuing from current position.
  */
-#define list_for_each_entry_from(pos, head, member) 			\
+#define cds_list_for_each_entry_from(pos, head, member) 			\
 	for (; prefetch(pos->member.next), &pos->member != (head);	\
-	     pos = list_entry(pos->member.next, typeof(*pos), member))
+	     pos = cds_list_entry(pos->member.next, typeof(*pos), member))
 
 /**
- * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
+ * cds_list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
  * @pos:	the type * to use as a loop cursor.
  * @n:		another type * to use as temporary storage
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
  */
-#define list_for_each_entry_safe(pos, n, head, member)			\
-	for (pos = list_entry((head)->next, typeof(*pos), member),	\
-		n = list_entry(pos->member.next, typeof(*pos), member);	\
+#define cds_list_for_each_entry_safe(pos, n, head, member)			\
+	for (pos = cds_list_entry((head)->next, typeof(*pos), member),	\
+		n = cds_list_entry(pos->member.next, typeof(*pos), member);	\
 	     &pos->member != (head); 					\
-	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
+	     pos = n, n = cds_list_entry(n->member.next, typeof(*n), member))
 
 /**
- * list_for_each_entry_safe_continue
+ * cds_list_for_each_entry_safe_continue
  * @pos:	the type * to use as a loop cursor.
  * @n:		another type * to use as temporary storage
  * @head:	the head for your list.
@@ -1133,14 +1133,14 @@ static inline void list_splice_tail_init(struct list_head *list,
  * Iterate over list of given type, continuing after current point,
  * safe against removal of list entry.
  */
-#define list_for_each_entry_safe_continue(pos, n, head, member) 		\
-	for (pos = list_entry(pos->member.next, typeof(*pos), member), 		\
-		n = list_entry(pos->member.next, typeof(*pos), member);		\
+#define cds_list_for_each_entry_safe_continue(pos, n, head, member) 		\
+	for (pos = cds_list_entry(pos->member.next, typeof(*pos), member), 		\
+		n = cds_list_entry(pos->member.next, typeof(*pos), member);		\
 	     &pos->member != (head);						\
-	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
+	     pos = n, n = cds_list_entry(n->member.next, typeof(*n), member))
 
 /**
- * list_for_each_entry_safe_from
+ * cds_list_for_each_entry_safe_from
  * @pos:	the type * to use as a loop cursor.
  * @n:		another type * to use as temporary storage
  * @head:	the head for your list.
@@ -1149,13 +1149,13 @@ static inline void list_splice_tail_init(struct list_head *list,
  * Iterate over list of given type from current point, safe against
  * removal of list entry.
  */
-#define list_for_each_entry_safe_from(pos, n, head, member) 			\
-	for (n = list_entry(pos->member.next, typeof(*pos), member);		\
+#define cds_list_for_each_entry_safe_from(pos, n, head, member) 			\
+	for (n = cds_list_entry(pos->member.next, typeof(*pos), member);		\
 	     &pos->member != (head);						\
-	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
+	     pos = n, n = cds_list_entry(n->member.next, typeof(*n), member))
 
 /**
- * list_for_each_entry_safe_reverse
+ * cds_list_for_each_entry_safe_reverse
  * @pos:	the type * to use as a loop cursor.
  * @n:		another type * to use as temporary storage
  * @head:	the head for your list.
@@ -1164,11 +1164,11 @@ static inline void list_splice_tail_init(struct list_head *list,
  * Iterate backwards over list of given type, safe against removal
  * of list entry.
  */
-#define list_for_each_entry_safe_reverse(pos, n, head, member)		\
-	for (pos = list_entry((head)->prev, typeof(*pos), member),	\
-		n = list_entry(pos->member.prev, typeof(*pos), member);	\
+#define cds_list_for_each_entry_safe_reverse(pos, n, head, member)		\
+	for (pos = cds_list_entry((head)->prev, typeof(*pos), member),	\
+		n = cds_list_entry(pos->member.prev, typeof(*pos), member);	\
 	     &pos->member != (head); 					\
-	     pos = n, n = list_entry(n->member.prev, typeof(*n), member))
+	     pos = n, n = cds_list_entry(n->member.prev, typeof(*n), member))
 
 #endif //0
 
@@ -1179,60 +1179,60 @@ static inline void list_splice_tail_init(struct list_head *list,
  * You lose the ability to access the tail in O(1).
  */
 
-struct hlist_head {
-	struct hlist_node *first;
+struct cds_hlist_head {
+	struct cds_hlist_node *first;
 };
 
-struct hlist_node {
-	struct hlist_node *next, **pprev;
+struct cds_hlist_node {
+	struct cds_hlist_node *next, **pprev;
 };
 
 #define HLIST_HEAD_INIT { .first = NULL }
-#define HLIST_HEAD(name) struct hlist_head name = {  .first = NULL }
-#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL)
-static inline void INIT_HLIST_NODE(struct hlist_node *h)
+#define HLIST_HEAD(name) struct cds_hlist_head name = {  .first = NULL }
+#define CDS_INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL)
+static inline void INIT_HLIST_NODE(struct cds_hlist_node *h)
 {
 	h->next = NULL;
 	h->pprev = NULL;
 }
 
-static inline int hlist_unhashed(const struct hlist_node *h)
+static inline int hlist_unhashed(const struct cds_hlist_node *h)
 {
 	return !h->pprev;
 }
 
-static inline int hlist_empty(const struct hlist_head *h)
+static inline int hlist_empty(const struct cds_hlist_head *h)
 {
 	return !h->first;
 }
 
-static inline void __hlist_del(struct hlist_node *n)
+static inline void __cds_hlist_del(struct cds_hlist_node *n)
 {
-	struct hlist_node *next = n->next;
-	struct hlist_node **pprev = n->pprev;
+	struct cds_hlist_node *next = n->next;
+	struct cds_hlist_node **pprev = n->pprev;
 	*pprev = next;
 	if (next)
 		next->pprev = pprev;
 }
 
-static inline void hlist_del(struct hlist_node *n)
+static inline void cds_hlist_del(struct cds_hlist_node *n)
 {
-	__hlist_del(n);
+	__cds_hlist_del(n);
 	n->next = LIST_POISON1;
 	n->pprev = LIST_POISON2;
 }
 
-static inline void hlist_del_init(struct hlist_node *n)
+static inline void cds_hlist_del_init(struct cds_hlist_node *n)
 {
 	if (!hlist_unhashed(n)) {
-		__hlist_del(n);
+		__cds_hlist_del(n);
 		INIT_HLIST_NODE(n);
 	}
 }
 
-static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
+static inline void cds_hlist_add_head(struct cds_hlist_node *n, struct cds_hlist_head *h)
 {
-	struct hlist_node *first = h->first;
+	struct cds_hlist_node *first = h->first;
 	n->next = first;
 	if (first)
 		first->pprev = &n->next;
@@ -1241,8 +1241,8 @@ static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
 }
 
 /* next must be != NULL */
-static inline void hlist_add_before(struct hlist_node *n,
-					struct hlist_node *next)
+static inline void hlist_add_before(struct cds_hlist_node *n,
+					struct cds_hlist_node *next)
 {
 	n->pprev = next->pprev;
 	n->next = next;
@@ -1250,8 +1250,8 @@ static inline void hlist_add_before(struct hlist_node *n,
 	*(n->pprev) = n;
 }
 
-static inline void hlist_add_after(struct hlist_node *n,
-					struct hlist_node *next)
+static inline void hlist_add_after(struct cds_hlist_node *n,
+					struct cds_hlist_node *next)
 {
 	next->next = n->next;
 	n->next = next;
@@ -1265,8 +1265,8 @@ static inline void hlist_add_after(struct hlist_node *n,
  * Move a list from one list head to another. Fixup the pprev
  * reference of the first entry if it exists.
  */
-static inline void hlist_move_list(struct hlist_head *old,
-				   struct hlist_head *new)
+static inline void hlist_move_list(struct cds_hlist_head *old,
+				   struct cds_hlist_head *new)
 {
 	new->first = old->first;
 	if (new->first)
@@ -1274,64 +1274,64 @@ static inline void hlist_move_list(struct hlist_head *old,
 	old->first = NULL;
 }
 
-#define hlist_entry(ptr, type, member) caa_container_of(ptr,type,member)
+#define cds_hlist_entry(ptr, type, member) caa_container_of(ptr,type,member)
 
-#define hlist_for_each(pos, head) \
+#define cds_hlist_for_each(pos, head) \
 	for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \
 	     pos = pos->next)
 
-#define hlist_for_each_safe(pos, n, head) \
+#define cds_hlist_for_each_safe(pos, n, head) \
 	for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
 	     pos = n)
 
 /**
- * hlist_for_each_entry	- iterate over list of given type
+ * cds_hlist_for_each_entry	- iterate over list of given type
  * @tpos:	the type * to use as a loop cursor.
- * @pos:	the &struct hlist_node to use as a loop cursor.
+ * @pos:	the &struct cds_hlist_node to use as a loop cursor.
  * @head:	the head for your list.
- * @member:	the name of the hlist_node within the struct.
+ * @member:	the name of the cds_hlist_node within the struct.
  */
-#define hlist_for_each_entry(tpos, pos, head, member)			 \
+#define cds_hlist_for_each_entry(tpos, pos, head, member)			 \
 	for (pos = (head)->first;					 \
 	     pos && ({ prefetch(pos->next); 1;}) &&			 \
-		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+		({ tpos = cds_hlist_entry(pos, typeof(*tpos), member); 1;}); \
 	     pos = pos->next)
 
 /**
- * hlist_for_each_entry_continue - iterate over a hlist continuing after current point
+ * cds_hlist_for_each_entry_continue - iterate over a hlist continuing after current point
  * @tpos:	the type * to use as a loop cursor.
- * @pos:	the &struct hlist_node to use as a loop cursor.
- * @member:	the name of the hlist_node within the struct.
+ * @pos:	the &struct cds_hlist_node to use as a loop cursor.
+ * @member:	the name of the cds_hlist_node within the struct.
  */
-#define hlist_for_each_entry_continue(tpos, pos, member)		 \
+#define cds_hlist_for_each_entry_continue(tpos, pos, member)		 \
 	for (pos = (pos)->next;						 \
 	     pos && ({ prefetch(pos->next); 1;}) &&			 \
-		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+		({ tpos = cds_hlist_entry(pos, typeof(*tpos), member); 1;}); \
 	     pos = pos->next)
 
 /**
- * hlist_for_each_entry_from - iterate over a hlist continuing from current point
+ * cds_hlist_for_each_entry_from - iterate over a hlist continuing from current point
  * @tpos:	the type * to use as a loop cursor.
- * @pos:	the &struct hlist_node to use as a loop cursor.
- * @member:	the name of the hlist_node within the struct.
+ * @pos:	the &struct cds_hlist_node to use as a loop cursor.
+ * @member:	the name of the cds_hlist_node within the struct.
  */
-#define hlist_for_each_entry_from(tpos, pos, member)			 \
+#define cds_hlist_for_each_entry_from(tpos, pos, member)			 \
 	for (; pos && ({ prefetch(pos->next); 1;}) &&			 \
-		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+		({ tpos = cds_hlist_entry(pos, typeof(*tpos), member); 1;}); \
 	     pos = pos->next)
 
 /**
- * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
+ * cds_hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
  * @tpos:	the type * to use as a loop cursor.
- * @pos:	the &struct hlist_node to use as a loop cursor.
- * @n:		another &struct hlist_node to use as temporary storage
+ * @pos:	the &struct cds_hlist_node to use as a loop cursor.
+ * @n:		another &struct cds_hlist_node to use as temporary storage
  * @head:	the head for your list.
- * @member:	the name of the hlist_node within the struct.
+ * @member:	the name of the cds_hlist_node within the struct.
  */
-#define hlist_for_each_entry_safe(tpos, pos, n, head, member) 		 \
+#define cds_hlist_for_each_entry_safe(tpos, pos, n, head, member) 		 \
 	for (pos = (head)->first;					 \
 	     pos && ({ n = pos->next; 1; }) && 				 \
-		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+		({ tpos = cds_hlist_entry(pos, typeof(*tpos), member); 1;}); \
 	     pos = n)
 
 #endif
diff --git a/tests/api_ppc.h b/tests/api_ppc.h
index 5c5f6e9..038c9cb 100644
--- a/tests/api_ppc.h
+++ b/tests/api_ppc.h
@@ -1015,16 +1015,16 @@ static void smp_init(void)
  * using the generic single-entry routines.
  */
 
-struct list_head {
-	struct list_head *next, *prev;
+struct cds_list_head {
+	struct cds_list_head *next, *prev;
 };
 
-#define LIST_HEAD_INIT(name) { &(name), &(name) }
+#define CDS_LIST_HEAD_INIT(name) { &(name), &(name) }
 
-#define LIST_HEAD(name) \
-	struct list_head name = LIST_HEAD_INIT(name)
+#define CDS_LIST_HEAD(name) \
+	struct cds_list_head name = CDS_LIST_HEAD_INIT(name)
 
-static inline void INIT_LIST_HEAD(struct list_head *list)
+static inline void CDS_INIT_LIST_HEAD(struct cds_list_head *list)
 {
 	list->next = list;
 	list->prev = list;
@@ -1037,9 +1037,9 @@ static inline void INIT_LIST_HEAD(struct list_head *list)
  * the prev/next entries already!
  */
 #ifndef CONFIG_DEBUG_LIST
-static inline void __list_add(struct list_head *new,
-			      struct list_head *prev,
-			      struct list_head *next)
+static inline void __cds_list_add(struct cds_list_head *new,
+			      struct cds_list_head *prev,
+			      struct cds_list_head *next)
 {
 	next->prev = new;
 	new->next = next;
@@ -1047,36 +1047,36 @@ static inline void __list_add(struct list_head *new,
 	prev->next = new;
 }
 #else
-extern void __list_add(struct list_head *new,
-			      struct list_head *prev,
-			      struct list_head *next);
+extern void __cds_list_add(struct cds_list_head *new,
+			      struct cds_list_head *prev,
+			      struct cds_list_head *next);
 #endif
 
 /**
- * list_add - add a new entry
+ * cds_list_add - add a new entry
  * @new: new entry to be added
  * @head: list head to add it after
  *
  * Insert a new entry after the specified head.
  * This is good for implementing stacks.
  */
-static inline void list_add(struct list_head *new, struct list_head *head)
+static inline void cds_list_add(struct cds_list_head *new, struct cds_list_head *head)
 {
-	__list_add(new, head, head->next);
+	__cds_list_add(new, head, head->next);
 }
 
 
 /**
- * list_add_tail - add a new entry
+ * cds_list_add_tail - add a new entry
  * @new: new entry to be added
  * @head: list head to add it before
  *
  * Insert a new entry before the specified head.
  * This is useful for implementing queues.
  */
-static inline void list_add_tail(struct list_head *new, struct list_head *head)
+static inline void cds_list_add_tail(struct cds_list_head *new, struct cds_list_head *head)
 {
-	__list_add(new, head->prev, head);
+	__cds_list_add(new, head->prev, head);
 }
 
 /*
@@ -1086,38 +1086,38 @@ static inline void list_add_tail(struct list_head *new, struct list_head *head)
  * This is only for internal list manipulation where we know
  * the prev/next entries already!
  */
-static inline void __list_del(struct list_head * prev, struct list_head * next)
+static inline void __cds_list_del(struct cds_list_head * prev, struct cds_list_head * next)
 {
 	next->prev = prev;
 	prev->next = next;
 }
 
 /**
- * list_del - deletes entry from list.
+ * cds_list_del - deletes entry from list.
  * @entry: the element to delete from the list.
- * Note: list_empty() on entry does not return true after this, the entry is
+ * Note: cds_list_empty() on entry does not return true after this, the entry is
  * in an undefined state.
  */
 #ifndef CONFIG_DEBUG_LIST
-static inline void list_del(struct list_head *entry)
+static inline void cds_list_del(struct cds_list_head *entry)
 {
-	__list_del(entry->prev, entry->next);
+	__cds_list_del(entry->prev, entry->next);
 	entry->next = LIST_POISON1;
 	entry->prev = LIST_POISON2;
 }
 #else
-extern void list_del(struct list_head *entry);
+extern void cds_list_del(struct cds_list_head *entry);
 #endif
 
 /**
- * list_replace - replace old entry by new one
+ * cds_list_replace - replace old entry by new one
  * @old : the element to be replaced
  * @new : the new element to insert
  *
  * If @old was empty, it will be overwritten.
  */
-static inline void list_replace(struct list_head *old,
-				struct list_head *new)
+static inline void cds_list_replace(struct cds_list_head *old,
+				struct cds_list_head *new)
 {
 	new->next = old->next;
 	new->next->prev = new;
@@ -1125,44 +1125,44 @@ static inline void list_replace(struct list_head *old,
 	new->prev->next = new;
 }
 
-static inline void list_replace_init(struct list_head *old,
-					struct list_head *new)
+static inline void cds_list_replace_init(struct cds_list_head *old,
+					struct cds_list_head *new)
 {
-	list_replace(old, new);
-	INIT_LIST_HEAD(old);
+	cds_list_replace(old, new);
+	CDS_INIT_LIST_HEAD(old);
 }
 
 /**
- * list_del_init - deletes entry from list and reinitialize it.
+ * cds_list_del_init - deletes entry from list and reinitialize it.
  * @entry: the element to delete from the list.
  */
-static inline void list_del_init(struct list_head *entry)
+static inline void cds_list_del_init(struct cds_list_head *entry)
 {
-	__list_del(entry->prev, entry->next);
-	INIT_LIST_HEAD(entry);
+	__cds_list_del(entry->prev, entry->next);
+	CDS_INIT_LIST_HEAD(entry);
 }
 
 /**
- * list_move - delete from one list and add as another's head
+ * cds_list_move - delete from one list and add as another's head
  * @list: the entry to move
  * @head: the head that will precede our entry
  */
-static inline void list_move(struct list_head *list, struct list_head *head)
+static inline void cds_list_move(struct cds_list_head *list, struct cds_list_head *head)
 {
-	__list_del(list->prev, list->next);
-	list_add(list, head);
+	__cds_list_del(list->prev, list->next);
+	cds_list_add(list, head);
 }
 
 /**
- * list_move_tail - delete from one list and add as another's tail
+ * cds_list_move_tail - delete from one list and add as another's tail
  * @list: the entry to move
  * @head: the head that will follow our entry
  */
-static inline void list_move_tail(struct list_head *list,
-				  struct list_head *head)
+static inline void cds_list_move_tail(struct cds_list_head *list,
+				  struct cds_list_head *head)
 {
-	__list_del(list->prev, list->next);
-	list_add_tail(list, head);
+	__cds_list_del(list->prev, list->next);
+	cds_list_add_tail(list, head);
 }
 
 /**
@@ -1170,37 +1170,37 @@ static inline void list_move_tail(struct list_head *list,
  * @list: the entry to test
  * @head: the head of the list
  */
-static inline int list_is_last(const struct list_head *list,
-				const struct list_head *head)
+static inline int list_is_last(const struct cds_list_head *list,
+				const struct cds_list_head *head)
 {
 	return list->next == head;
 }
 
 /**
- * list_empty - tests whether a list is empty
+ * cds_list_empty - tests whether a list is empty
  * @head: the list to test.
  */
-static inline int list_empty(const struct list_head *head)
+static inline int cds_list_empty(const struct cds_list_head *head)
 {
 	return head->next == head;
 }
 
 /**
- * list_empty_careful - tests whether a list is empty and not being modified
+ * cds_list_empty_careful - tests whether a list is empty and not being modified
  * @head: the list to test
  *
  * Description:
  * tests whether a list is empty _and_ checks that no other CPU might be
  * in the process of modifying either member (next or prev)
  *
- * NOTE: using list_empty_careful() without synchronization
+ * NOTE: using cds_list_empty_careful() without synchronization
  * can only be safe if the only activity that can happen
- * to the list entry is list_del_init(). Eg. it cannot be used
+ * to the list entry is cds_list_del_init(). Eg. it cannot be used
  * if another CPU could re-list_add() it.
  */
-static inline int list_empty_careful(const struct list_head *head)
+static inline int cds_list_empty_careful(const struct cds_list_head *head)
 {
-	struct list_head *next = head->next;
+	struct cds_list_head *next = head->next;
 	return (next == head) && (next == head->prev);
 }
 
@@ -1208,15 +1208,15 @@ static inline int list_empty_careful(const struct list_head *head)
  * list_is_singular - tests whether a list has just one entry.
  * @head: the list to test.
  */
-static inline int list_is_singular(const struct list_head *head)
+static inline int list_is_singular(const struct cds_list_head *head)
 {
 	return !list_empty(head) && (head->next == head->prev);
 }
 
-static inline void __list_cut_position(struct list_head *list,
-		struct list_head *head, struct list_head *entry)
+static inline void __list_cut_position(struct cds_list_head *list,
+		struct cds_list_head *head, struct cds_list_head *entry)
 {
-	struct list_head *new_first = entry->next;
+	struct cds_list_head *new_first = entry->next;
 	list->next = head->next;
 	list->next->prev = list;
 	list->prev = entry;
@@ -1239,26 +1239,26 @@ static inline void __list_cut_position(struct list_head *list,
  * losing its data.
  *
  */
-static inline void list_cut_position(struct list_head *list,
-		struct list_head *head, struct list_head *entry)
+static inline void list_cut_position(struct cds_list_head *list,
+		struct cds_list_head *head, struct cds_list_head *entry)
 {
-	if (list_empty(head))
+	if (cds_list_empty(head))
 		return;
 	if (list_is_singular(head) &&
 		(head->next != entry && head != entry))
 		return;
 	if (entry == head)
-		INIT_LIST_HEAD(list);
+		CDS_INIT_LIST_HEAD(list);
 	else
 		__list_cut_position(list, head, entry);
 }
 
-static inline void __list_splice(const struct list_head *list,
-				 struct list_head *prev,
-				 struct list_head *next)
+static inline void __cds_list_splice(const struct cds_list_head *list,
+				 struct cds_list_head *prev,
+				 struct cds_list_head *next)
 {
-	struct list_head *first = list->next;
-	struct list_head *last = list->prev;
+	struct cds_list_head *first = list->next;
+	struct cds_list_head *last = list->prev;
 
 	first->prev = prev;
 	prev->next = first;
@@ -1268,69 +1268,69 @@ static inline void __list_splice(const struct list_head *list,
 }
 
 /**
- * list_splice - join two lists, this is designed for stacks
+ * cds_list_splice - join two lists, this is designed for stacks
  * @list: the new list to add.
  * @head: the place to add it in the first list.
  */
-static inline void list_splice(const struct list_head *list,
-				struct list_head *head)
+static inline void cds_list_splice(const struct cds_list_head *list,
+				struct cds_list_head *head)
 {
-	if (!list_empty(list))
-		__list_splice(list, head, head->next);
+	if (!cds_list_empty(list))
+		__cds_list_splice(list, head, head->next);
 }
 
 /**
- * list_splice_tail - join two lists, each list being a queue
+ * cds_list_splice_tail - join two lists, each list being a queue
  * @list: the new list to add.
  * @head: the place to add it in the first list.
  */
-static inline void list_splice_tail(struct list_head *list,
-				struct list_head *head)
+static inline void cds_list_splice_tail(struct cds_list_head *list,
+				struct cds_list_head *head)
 {
-	if (!list_empty(list))
-		__list_splice(list, head->prev, head);
+	if (!cds_list_empty(list))
+		__cds_list_splice(list, head->prev, head);
 }
 
 /**
- * list_splice_init - join two lists and reinitialise the emptied list.
+ * cds_list_splice_init - join two lists and reinitialise the emptied list.
  * @list: the new list to add.
  * @head: the place to add it in the first list.
  *
  * The list at @list is reinitialised
  */
-static inline void list_splice_init(struct list_head *list,
-				    struct list_head *head)
+static inline void cds_list_splice_init(struct cds_list_head *list,
+				    struct cds_list_head *head)
 {
-	if (!list_empty(list)) {
-		__list_splice(list, head, head->next);
-		INIT_LIST_HEAD(list);
+	if (!cds_list_empty(list)) {
+		__cds_list_splice(list, head, head->next);
+		CDS_INIT_LIST_HEAD(list);
 	}
 }
 
 /**
- * list_splice_tail_init - join two lists and reinitialise the emptied list
+ * cds_list_splice_tail_init - join two lists and reinitialise the emptied list
  * @list: the new list to add.
  * @head: the place to add it in the first list.
  *
  * Each of the lists is a queue.
  * The list at @list is reinitialised
  */
-static inline void list_splice_tail_init(struct list_head *list,
-					 struct list_head *head)
+static inline void cds_list_splice_tail_init(struct cds_list_head *list,
+					 struct cds_list_head *head)
 {
-	if (!list_empty(list)) {
-		__list_splice(list, head->prev, head);
-		INIT_LIST_HEAD(list);
+	if (!cds_list_empty(list)) {
+		__cds_list_splice(list, head->prev, head);
+		CDS_INIT_LIST_HEAD(list);
 	}
 }
 
 /**
- * list_entry - get the struct for this entry
- * @ptr:	the &struct list_head pointer.
+ * cds_list_entry - get the struct for this entry
+ * @ptr:	the &struct cds_list_head pointer.
  * @type:	the type of the struct this is embedded in.
  * @member:	the name of the list_struct within the struct.
  */
-#define list_entry(ptr, type, member) \
+#define cds_list_entry(ptr, type, member) \
 	caa_container_of(ptr, type, member)
 
 /**
@@ -1342,95 +1342,95 @@ static inline void list_splice_tail_init(struct list_head *list,
  * Note, that list is expected to be not empty.
  */
 #define list_first_entry(ptr, type, member) \
-	list_entry((ptr)->next, type, member)
+	cds_list_entry((ptr)->next, type, member)
 
 /**
- * list_for_each	-	iterate over a list
- * @pos:	the &struct list_head to use as a loop cursor.
+ * cds_list_for_each	-	iterate over a list
+ * @pos:	the &struct cds_list_head to use as a loop cursor.
  * @head:	the head for your list.
  */
-#define list_for_each(pos, head) \
+#define cds_list_for_each(pos, head) \
 	for (pos = (head)->next; prefetch(pos->next), pos != (head); \
         	pos = pos->next)
 
 /**
- * __list_for_each	-	iterate over a list
- * @pos:	the &struct list_head to use as a loop cursor.
+ * __cds_list_for_each	-	iterate over a list
+ * @pos:	the &struct cds_list_head to use as a loop cursor.
  * @head:	the head for your list.
  *
- * This variant differs from list_for_each() in that it's the
+ * This variant differs from cds_list_for_each() in that it's the
  * simplest possible list iteration code, no prefetching is done.
  * Use this for code that knows the list to be very short (empty
  * or 1 entry) most of the time.
  */
-#define __list_for_each(pos, head) \
+#define __cds_list_for_each(pos, head) \
 	for (pos = (head)->next; pos != (head); pos = pos->next)
 
 /**
- * list_for_each_prev	-	iterate over a list backwards
- * @pos:	the &struct list_head to use as a loop cursor.
+ * cds_list_for_each_prev	-	iterate over a list backwards
+ * @pos:	the &struct cds_list_head to use as a loop cursor.
  * @head:	the head for your list.
  */
-#define list_for_each_prev(pos, head) \
+#define cds_list_for_each_prev(pos, head) \
 	for (pos = (head)->prev; prefetch(pos->prev), pos != (head); \
         	pos = pos->prev)
 
 /**
- * list_for_each_safe - iterate over a list safe against removal of list entry
- * @pos:	the &struct list_head to use as a loop cursor.
- * @n:		another &struct list_head to use as temporary storage
+ * cds_list_for_each_safe - iterate over a list safe against removal of list entry
+ * @pos:	the &struct cds_list_head to use as a loop cursor.
+ * @n:		another &struct cds_list_head to use as temporary storage
  * @head:	the head for your list.
  */
-#define list_for_each_safe(pos, n, head) \
+#define cds_list_for_each_safe(pos, n, head) \
 	for (pos = (head)->next, n = pos->next; pos != (head); \
 		pos = n, n = pos->next)
 
 /**
- * list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
- * @pos:	the &struct list_head to use as a loop cursor.
- * @n:		another &struct list_head to use as temporary storage
+ * cds_list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
+ * @pos:	the &struct cds_list_head to use as a loop cursor.
+ * @n:		another &struct cds_list_head to use as temporary storage
  * @head:	the head for your list.
  */
-#define list_for_each_prev_safe(pos, n, head) \
+#define cds_list_for_each_prev_safe(pos, n, head) \
 	for (pos = (head)->prev, n = pos->prev; \
 	     prefetch(pos->prev), pos != (head); \
 	     pos = n, n = pos->prev)
 
 /**
- * list_for_each_entry	-	iterate over list of given type
+ * cds_list_for_each_entry	-	iterate over list of given type
  * @pos:	the type * to use as a loop cursor.
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
  */
-#define list_for_each_entry(pos, head, member)				\
-	for (pos = list_entry((head)->next, typeof(*pos), member);	\
+#define cds_list_for_each_entry(pos, head, member)				\
+	for (pos = cds_list_entry((head)->next, typeof(*pos), member);	\
 	     prefetch(pos->member.next), &pos->member != (head); 	\
-	     pos = list_entry(pos->member.next, typeof(*pos), member))
+	     pos = cds_list_entry(pos->member.next, typeof(*pos), member))
 
 /**
- * list_for_each_entry_reverse - iterate backwards over list of given type.
+ * cds_list_for_each_entry_reverse - iterate backwards over list of given type.
  * @pos:	the type * to use as a loop cursor.
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
  */
-#define list_for_each_entry_reverse(pos, head, member)			\
-	for (pos = list_entry((head)->prev, typeof(*pos), member);	\
+#define cds_list_for_each_entry_reverse(pos, head, member)			\
+	for (pos = cds_list_entry((head)->prev, typeof(*pos), member);	\
 	     prefetch(pos->member.prev), &pos->member != (head); 	\
-	     pos = list_entry(pos->member.prev, typeof(*pos), member))
+	     pos = cds_list_entry(pos->member.prev, typeof(*pos), member))
 
 /**
- * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue()
+ * list_prepare_entry - prepare a pos entry for use in cds_list_for_each_entry_continue()
  * @pos:	the type * to use as a start point
  * @head:	the head of the list
  * @member:	the name of the list_struct within the struct.
  *
- * Prepares a pos entry for use as a start point in list_for_each_entry_continue().
+ * Prepares a pos entry for use as a start point in cds_list_for_each_entry_continue().
  */
 #define list_prepare_entry(pos, head, member) \
-	((pos) ? : list_entry(head, typeof(*pos), member))
+	((pos) ? : cds_list_entry(head, typeof(*pos), member))
 
 /**
- * list_for_each_entry_continue - continue iteration over list of given type
+ * cds_list_for_each_entry_continue - continue iteration over list of given type
  * @pos:	the type * to use as a loop cursor.
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
@@ -1438,13 +1438,13 @@ static inline void list_splice_tail_init(struct list_head *list,
  * Continue to iterate over list of given type, continuing after
  * the current position.
  */
-#define list_for_each_entry_continue(pos, head, member) 		\
-	for (pos = list_entry(pos->member.next, typeof(*pos), member);	\
+#define cds_list_for_each_entry_continue(pos, head, member) 		\
+	for (pos = cds_list_entry(pos->member.next, typeof(*pos), member);	\
 	     prefetch(pos->member.next), &pos->member != (head);	\
-	     pos = list_entry(pos->member.next, typeof(*pos), member))
+	     pos = cds_list_entry(pos->member.next, typeof(*pos), member))
 
 /**
- * list_for_each_entry_continue_reverse - iterate backwards from the given point
+ * cds_list_for_each_entry_continue_reverse - iterate backwards from the given point
  * @pos:	the type * to use as a loop cursor.
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
@@ -1452,38 +1452,38 @@ static inline void list_splice_tail_init(struct list_head *list,
  * Start to iterate over list of given type backwards, continuing after
  * the current position.
  */
-#define list_for_each_entry_continue_reverse(pos, head, member)		\
-	for (pos = list_entry(pos->member.prev, typeof(*pos), member);	\
+#define cds_list_for_each_entry_continue_reverse(pos, head, member)		\
+	for (pos = cds_list_entry(pos->member.prev, typeof(*pos), member);	\
 	     prefetch(pos->member.prev), &pos->member != (head);	\
-	     pos = list_entry(pos->member.prev, typeof(*pos), member))
+	     pos = cds_list_entry(pos->member.prev, typeof(*pos), member))
 
 /**
- * list_for_each_entry_from - iterate over list of given type from the current point
+ * cds_list_for_each_entry_from - iterate over list of given type from the current point
  * @pos:	the type * to use as a loop cursor.
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
  *
  * Iterate over list of given type, continuing from current position.
  */
-#define list_for_each_entry_from(pos, head, member) 			\
+#define cds_list_for_each_entry_from(pos, head, member) 			\
 	for (; prefetch(pos->member.next), &pos->member != (head);	\
-	     pos = list_entry(pos->member.next, typeof(*pos), member))
+	     pos = cds_list_entry(pos->member.next, typeof(*pos), member))
 
 /**
- * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
+ * cds_list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
  * @pos:	the type * to use as a loop cursor.
  * @n:		another type * to use as temporary storage
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
  */
-#define list_for_each_entry_safe(pos, n, head, member)			\
-	for (pos = list_entry((head)->next, typeof(*pos), member),	\
-		n = list_entry(pos->member.next, typeof(*pos), member);	\
+#define cds_list_for_each_entry_safe(pos, n, head, member)			\
+	for (pos = cds_list_entry((head)->next, typeof(*pos), member),	\
+		n = cds_list_entry(pos->member.next, typeof(*pos), member);	\
 	     &pos->member != (head); 					\
-	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
+	     pos = n, n = cds_list_entry(n->member.next, typeof(*n), member))
 
 /**
- * list_for_each_entry_safe_continue
+ * cds_list_for_each_entry_safe_continue
  * @pos:	the type * to use as a loop cursor.
  * @n:		another type * to use as temporary storage
  * @head:	the head for your list.
@@ -1492,14 +1492,14 @@ static inline void list_splice_tail_init(struct list_head *list,
  * Iterate over list of given type, continuing after current point,
  * safe against removal of list entry.
  */
-#define list_for_each_entry_safe_continue(pos, n, head, member) 		\
-	for (pos = list_entry(pos->member.next, typeof(*pos), member), 		\
-		n = list_entry(pos->member.next, typeof(*pos), member);		\
+#define cds_list_for_each_entry_safe_continue(pos, n, head, member) 		\
+	for (pos = cds_list_entry(pos->member.next, typeof(*pos), member), 		\
+		n = cds_list_entry(pos->member.next, typeof(*pos), member);		\
 	     &pos->member != (head);						\
-	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
+	     pos = n, n = cds_list_entry(n->member.next, typeof(*n), member))
 
 /**
- * list_for_each_entry_safe_from
+ * cds_list_for_each_entry_safe_from
  * @pos:	the type * to use as a loop cursor.
  * @n:		another type * to use as temporary storage
  * @head:	the head for your list.
@@ -1508,13 +1508,13 @@ static inline void list_splice_tail_init(struct list_head *list,
  * Iterate over list of given type from current point, safe against
  * removal of list entry.
  */
-#define list_for_each_entry_safe_from(pos, n, head, member) 			\
-	for (n = list_entry(pos->member.next, typeof(*pos), member);		\
+#define cds_list_for_each_entry_safe_from(pos, n, head, member) 			\
+	for (n = cds_list_entry(pos->member.next, typeof(*pos), member);		\
 	     &pos->member != (head);						\
-	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
+	     pos = n, n = cds_list_entry(n->member.next, typeof(*n), member))
 
 /**
- * list_for_each_entry_safe_reverse
+ * cds_list_for_each_entry_safe_reverse
  * @pos:	the type * to use as a loop cursor.
  * @n:		another type * to use as temporary storage
  * @head:	the head for your list.
@@ -1523,11 +1523,11 @@ static inline void list_splice_tail_init(struct list_head *list,
  * Iterate backwards over list of given type, safe against removal
  * of list entry.
  */
-#define list_for_each_entry_safe_reverse(pos, n, head, member)		\
-	for (pos = list_entry((head)->prev, typeof(*pos), member),	\
-		n = list_entry(pos->member.prev, typeof(*pos), member);	\
+#define cds_list_for_each_entry_safe_reverse(pos, n, head, member)		\
+	for (pos = cds_list_entry((head)->prev, typeof(*pos), member),	\
+		n = cds_list_entry(pos->member.prev, typeof(*pos), member);	\
 	     &pos->member != (head); 					\
-	     pos = n, n = list_entry(n->member.prev, typeof(*n), member))
+	     pos = n, n = cds_list_entry(n->member.prev, typeof(*n), member))
 
 #endif //0
 
@@ -1538,60 +1538,60 @@ static inline void list_splice_tail_init(struct list_head *list,
  * You lose the ability to access the tail in O(1).
  */
 
-struct hlist_head {
-	struct hlist_node *first;
+struct cds_hlist_head {
+	struct cds_hlist_node *first;
 };
 
-struct hlist_node {
-	struct hlist_node *next, **pprev;
+struct cds_hlist_node {
+	struct cds_hlist_node *next, **pprev;
 };
 
 #define HLIST_HEAD_INIT { .first = NULL }
-#define HLIST_HEAD(name) struct hlist_head name = {  .first = NULL }
-#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL)
-static inline void INIT_HLIST_NODE(struct hlist_node *h)
+#define HLIST_HEAD(name) struct cds_hlist_head name = {  .first = NULL }
+#define CDS_INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL)
+static inline void INIT_HLIST_NODE(struct cds_hlist_node *h)
 {
 	h->next = NULL;
 	h->pprev = NULL;
 }
 
-static inline int hlist_unhashed(const struct hlist_node *h)
+static inline int hlist_unhashed(const struct cds_hlist_node *h)
 {
 	return !h->pprev;
 }
 
-static inline int hlist_empty(const struct hlist_head *h)
+static inline int hlist_empty(const struct cds_hlist_head *h)
 {
 	return !h->first;
 }
 
-static inline void __hlist_del(struct hlist_node *n)
+static inline void __cds_hlist_del(struct cds_hlist_node *n)
 {
-	struct hlist_node *next = n->next;
-	struct hlist_node **pprev = n->pprev;
+	struct cds_hlist_node *next = n->next;
+	struct cds_hlist_node **pprev = n->pprev;
 	*pprev = next;
 	if (next)
 		next->pprev = pprev;
 }
 
-static inline void hlist_del(struct hlist_node *n)
+static inline void cds_hlist_del(struct cds_hlist_node *n)
 {
-	__hlist_del(n);
+	__cds_hlist_del(n);
 	n->next = LIST_POISON1;
 	n->pprev = LIST_POISON2;
 }
 
-static inline void hlist_del_init(struct hlist_node *n)
+static inline void cds_hlist_del_init(struct cds_hlist_node *n)
 {
 	if (!hlist_unhashed(n)) {
-		__hlist_del(n);
+		__cds_hlist_del(n);
 		INIT_HLIST_NODE(n);
 	}
 }
 
-static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
+static inline void cds_hlist_add_head(struct cds_hlist_node *n, struct cds_hlist_head *h)
 {
-	struct hlist_node *first = h->first;
+	struct cds_hlist_node *first = h->first;
 	n->next = first;
 	if (first)
 		first->pprev = &n->next;
@@ -1600,8 +1600,8 @@ static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
 }
 
 /* next must be != NULL */
-static inline void hlist_add_before(struct hlist_node *n,
-					struct hlist_node *next)
+static inline void hlist_add_before(struct cds_hlist_node *n,
+					struct cds_hlist_node *next)
 {
 	n->pprev = next->pprev;
 	n->next = next;
@@ -1609,8 +1609,8 @@ static inline void hlist_add_before(struct hlist_node *n,
 	*(n->pprev) = n;
 }
 
-static inline void hlist_add_after(struct hlist_node *n,
-					struct hlist_node *next)
+static inline void hlist_add_after(struct cds_hlist_node *n,
+					struct cds_hlist_node *next)
 {
 	next->next = n->next;
 	n->next = next;
@@ -1624,8 +1624,8 @@ static inline void hlist_add_after(struct hlist_node *n,
  * Move a list from one list head to another. Fixup the pprev
  * reference of the first entry if it exists.
  */
-static inline void hlist_move_list(struct hlist_head *old,
-				   struct hlist_head *new)
+static inline void hlist_move_list(struct cds_hlist_head *old,
+				   struct cds_hlist_head *new)
 {
 	new->first = old->first;
 	if (new->first)
@@ -1633,64 +1633,64 @@ static inline void hlist_move_list(struct hlist_head *old,
 	old->first = NULL;
 }
 
-#define hlist_entry(ptr, type, member) caa_container_of(ptr,type,member)
+#define cds_hlist_entry(ptr, type, member) caa_container_of(ptr,type,member)
 
-#define hlist_for_each(pos, head) \
+#define cds_hlist_for_each(pos, head) \
 	for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \
 	     pos = pos->next)
 
-#define hlist_for_each_safe(pos, n, head) \
+#define cds_hlist_for_each_safe(pos, n, head) \
 	for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
 	     pos = n)
 
 /**
- * hlist_for_each_entry	- iterate over list of given type
+ * cds_hlist_for_each_entry	- iterate over list of given type
  * @tpos:	the type * to use as a loop cursor.
- * @pos:	the &struct hlist_node to use as a loop cursor.
+ * @pos:	the &struct cds_hlist_node to use as a loop cursor.
  * @head:	the head for your list.
- * @member:	the name of the hlist_node within the struct.
+ * @member:	the name of the cds_hlist_node within the struct.
  */
-#define hlist_for_each_entry(tpos, pos, head, member)			 \
+#define cds_hlist_for_each_entry(tpos, pos, head, member)			 \
 	for (pos = (head)->first;					 \
 	     pos && ({ prefetch(pos->next); 1;}) &&			 \
-		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+		({ tpos = cds_hlist_entry(pos, typeof(*tpos), member); 1;}); \
 	     pos = pos->next)
 
 /**
- * hlist_for_each_entry_continue - iterate over a hlist continuing after current point
+ * cds_hlist_for_each_entry_continue - iterate over a hlist continuing after current point
  * @tpos:	the type * to use as a loop cursor.
- * @pos:	the &struct hlist_node to use as a loop cursor.
- * @member:	the name of the hlist_node within the struct.
+ * @pos:	the &struct cds_hlist_node to use as a loop cursor.
+ * @member:	the name of the cds_hlist_node within the struct.
  */
-#define hlist_for_each_entry_continue(tpos, pos, member)		 \
+#define cds_hlist_for_each_entry_continue(tpos, pos, member)		 \
 	for (pos = (pos)->next;						 \
 	     pos && ({ prefetch(pos->next); 1;}) &&			 \
-		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+		({ tpos = cds_hlist_entry(pos, typeof(*tpos), member); 1;}); \
 	     pos = pos->next)
 
 /**
- * hlist_for_each_entry_from - iterate over a hlist continuing from current point
+ * cds_hlist_for_each_entry_from - iterate over a hlist continuing from current point
  * @tpos:	the type * to use as a loop cursor.
- * @pos:	the &struct hlist_node to use as a loop cursor.
- * @member:	the name of the hlist_node within the struct.
+ * @pos:	the &struct cds_hlist_node to use as a loop cursor.
+ * @member:	the name of the cds_hlist_node within the struct.
  */
-#define hlist_for_each_entry_from(tpos, pos, member)			 \
+#define cds_hlist_for_each_entry_from(tpos, pos, member)			 \
 	for (; pos && ({ prefetch(pos->next); 1;}) &&			 \
-		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+		({ tpos = cds_hlist_entry(pos, typeof(*tpos), member); 1;}); \
 	     pos = pos->next)
 
 /**
- * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
+ * cds_hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
  * @tpos:	the type * to use as a loop cursor.
- * @pos:	the &struct hlist_node to use as a loop cursor.
- * @n:		another &struct hlist_node to use as temporary storage
+ * @pos:	the &struct cds_hlist_node to use as a loop cursor.
+ * @n:		another &struct cds_hlist_node to use as temporary storage
  * @head:	the head for your list.
- * @member:	the name of the hlist_node within the struct.
+ * @member:	the name of the cds_hlist_node within the struct.
  */
-#define hlist_for_each_entry_safe(tpos, pos, n, head, member) 		 \
+#define cds_hlist_for_each_entry_safe(tpos, pos, n, head, member) 		 \
 	for (pos = (head)->first;					 \
 	     pos && ({ n = pos->next; 1; }) && 				 \
-		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+		({ tpos = cds_hlist_entry(pos, typeof(*tpos), member); 1;}); \
 	     pos = n)
 
 #endif
diff --git a/tests/api_x86.h b/tests/api_x86.h
index 0365432..c774c32 100644
--- a/tests/api_x86.h
+++ b/tests/api_x86.h
@@ -718,16 +718,16 @@ static void smp_init(void)
  * using the generic single-entry routines.
  */
 
-struct list_head {
-	struct list_head *next, *prev;
+struct cds_list_head {
+	struct cds_list_head *next, *prev;
 };
 
-#define LIST_HEAD_INIT(name) { &(name), &(name) }
+#define CDS_LIST_HEAD_INIT(name) { &(name), &(name) }
 
-#define LIST_HEAD(name) \
-	struct list_head name = LIST_HEAD_INIT(name)
+#define CDS_LIST_HEAD(name) \
+	struct cds_list_head name = CDS_LIST_HEAD_INIT(name)
 
-static inline void INIT_LIST_HEAD(struct list_head *list)
+static inline void CDS_INIT_LIST_HEAD(struct cds_list_head *list)
 {
 	list->next = list;
 	list->prev = list;
@@ -740,9 +740,9 @@ static inline void INIT_LIST_HEAD(struct list_head *list)
  * the prev/next entries already!
  */
 #ifndef CONFIG_DEBUG_LIST
-static inline void __list_add(struct list_head *new,
-			      struct list_head *prev,
-			      struct list_head *next)
+static inline void __cds_list_add(struct cds_list_head *new,
+			      struct cds_list_head *prev,
+			      struct cds_list_head *next)
 {
 	next->prev = new;
 	new->next = next;
@@ -750,36 +750,36 @@ static inline void __list_add(struct list_head *new,
 	prev->next = new;
 }
 #else
-extern void __list_add(struct list_head *new,
-			      struct list_head *prev,
-			      struct list_head *next);
+extern void __cds_list_add(struct cds_list_head *new,
+			      struct cds_list_head *prev,
+			      struct cds_list_head *next);
 #endif
 
 /**
- * list_add - add a new entry
+ * cds_list_add - add a new entry
  * @new: new entry to be added
  * @head: list head to add it after
  *
  * Insert a new entry after the specified head.
  * This is good for implementing stacks.
  */
-static inline void list_add(struct list_head *new, struct list_head *head)
+static inline void cds_list_add(struct cds_list_head *new, struct cds_list_head *head)
 {
-	__list_add(new, head, head->next);
+	__cds_list_add(new, head, head->next);
 }
 
 
 /**
- * list_add_tail - add a new entry
+ * cds_list_add_tail - add a new entry
  * @new: new entry to be added
  * @head: list head to add it before
  *
  * Insert a new entry before the specified head.
  * This is useful for implementing queues.
  */
-static inline void list_add_tail(struct list_head *new, struct list_head *head)
+static inline void cds_list_add_tail(struct cds_list_head *new, struct cds_list_head *head)
 {
-	__list_add(new, head->prev, head);
+	__cds_list_add(new, head->prev, head);
 }
 
 /*
@@ -789,38 +789,38 @@ static inline void list_add_tail(struct list_head *new, struct list_head *head)
  * This is only for internal list manipulation where we know
  * the prev/next entries already!
  */
-static inline void __list_del(struct list_head * prev, struct list_head * next)
+static inline void __cds_list_del(struct cds_list_head * prev, struct cds_list_head * next)
 {
 	next->prev = prev;
 	prev->next = next;
 }
 
 /**
- * list_del - deletes entry from list.
+ * cds_list_del - deletes entry from list.
  * @entry: the element to delete from the list.
- * Note: list_empty() on entry does not return true after this, the entry is
+ * Note: cds_list_empty() on entry does not return true after this, the entry is
  * in an undefined state.
  */
 #ifndef CONFIG_DEBUG_LIST
-static inline void list_del(struct list_head *entry)
+static inline void cds_list_del(struct cds_list_head *entry)
 {
-	__list_del(entry->prev, entry->next);
+	__cds_list_del(entry->prev, entry->next);
 	entry->next = LIST_POISON1;
 	entry->prev = LIST_POISON2;
 }
 #else
-extern void list_del(struct list_head *entry);
+extern void cds_list_del(struct cds_list_head *entry);
 #endif
 
 /**
- * list_replace - replace old entry by new one
+ * cds_list_replace - replace old entry by new one
  * @old : the element to be replaced
  * @new : the new element to insert
  *
  * If @old was empty, it will be overwritten.
  */
-static inline void list_replace(struct list_head *old,
-				struct list_head *new)
+static inline void cds_list_replace(struct cds_list_head *old,
+				struct cds_list_head *new)
 {
 	new->next = old->next;
 	new->next->prev = new;
@@ -828,44 +828,44 @@ static inline void list_replace(struct list_head *old,
 	new->prev->next = new;
 }
 
-static inline void list_replace_init(struct list_head *old,
-					struct list_head *new)
+static inline void cds_list_replace_init(struct cds_list_head *old,
+					struct cds_list_head *new)
 {
-	list_replace(old, new);
-	INIT_LIST_HEAD(old);
+	cds_list_replace(old, new);
+	CDS_INIT_LIST_HEAD(old);
 }
 
 /**
- * list_del_init - deletes entry from list and reinitialize it.
+ * cds_list_del_init - deletes entry from list and reinitialize it.
  * @entry: the element to delete from the list.
  */
-static inline void list_del_init(struct list_head *entry)
+static inline void cds_list_del_init(struct cds_list_head *entry)
 {
-	__list_del(entry->prev, entry->next);
-	INIT_LIST_HEAD(entry);
+	__cds_list_del(entry->prev, entry->next);
+	CDS_INIT_LIST_HEAD(entry);
 }
 
 /**
- * list_move - delete from one list and add as another's head
+ * cds_list_move - delete from one list and add as another's head
  * @list: the entry to move
  * @head: the head that will precede our entry
  */
-static inline void list_move(struct list_head *list, struct list_head *head)
+static inline void cds_list_move(struct cds_list_head *list, struct cds_list_head *head)
 {
-	__list_del(list->prev, list->next);
-	list_add(list, head);
+	__cds_list_del(list->prev, list->next);
+	cds_list_add(list, head);
 }
 
 /**
- * list_move_tail - delete from one list and add as another's tail
+ * cds_list_move_tail - delete from one list and add as another's tail
  * @list: the entry to move
  * @head: the head that will follow our entry
  */
-static inline void list_move_tail(struct list_head *list,
-				  struct list_head *head)
+static inline void cds_list_move_tail(struct cds_list_head *list,
+				  struct cds_list_head *head)
 {
-	__list_del(list->prev, list->next);
-	list_add_tail(list, head);
+	__cds_list_del(list->prev, list->next);
+	cds_list_add_tail(list, head);
 }
 
 /**
@@ -873,37 +873,37 @@ static inline void list_move_tail(struct list_head *list,
  * @list: the entry to test
  * @head: the head of the list
  */
-static inline int list_is_last(const struct list_head *list,
-				const struct list_head *head)
+static inline int list_is_last(const struct cds_list_head *list,
+				const struct cds_list_head *head)
 {
 	return list->next == head;
 }
 
 /**
- * list_empty - tests whether a list is empty
+ * cds_list_empty - tests whether a list is empty
  * @head: the list to test.
  */
-static inline int list_empty(const struct list_head *head)
+static inline int cds_list_empty(const struct cds_list_head *head)
 {
 	return head->next == head;
 }
 
 /**
- * list_empty_careful - tests whether a list is empty and not being modified
+ * cds_list_empty_careful - tests whether a list is empty and not being modified
  * @head: the list to test
  *
  * Description:
  * tests whether a list is empty _and_ checks that no other CPU might be
  * in the process of modifying either member (next or prev)
  *
- * NOTE: using list_empty_careful() without synchronization
+ * NOTE: using cds_list_empty_careful() without synchronization
  * can only be safe if the only activity that can happen
- * to the list entry is list_del_init(). Eg. it cannot be used
+ * to the list entry is cds_list_del_init(). Eg. it cannot be used
  * if another CPU could re-list_add() it.
  */
-static inline int list_empty_careful(const struct list_head *head)
+static inline int cds_list_empty_careful(const struct cds_list_head *head)
 {
-	struct list_head *next = head->next;
+	struct cds_list_head *next = head->next;
 	return (next == head) && (next == head->prev);
 }
 
@@ -911,15 +911,15 @@ static inline int list_empty_careful(const struct list_head *head)
  * list_is_singular - tests whether a list has just one entry.
  * @head: the list to test.
  */
-static inline int list_is_singular(const struct list_head *head)
+static inline int list_is_singular(const struct cds_list_head *head)
 {
 	return !list_empty(head) && (head->next == head->prev);
 }
 
-static inline void __list_cut_position(struct list_head *list,
-		struct list_head *head, struct list_head *entry)
+static inline void __list_cut_position(struct cds_list_head *list,
+		struct cds_list_head *head, struct cds_list_head *entry)
 {
-	struct list_head *new_first = entry->next;
+	struct cds_list_head *new_first = entry->next;
 	list->next = head->next;
 	list->next->prev = list;
 	list->prev = entry;
@@ -942,26 +942,26 @@ static inline void __list_cut_position(struct list_head *list,
  * losing its data.
  *
  */
-static inline void list_cut_position(struct list_head *list,
-		struct list_head *head, struct list_head *entry)
+static inline void list_cut_position(struct cds_list_head *list,
+		struct cds_list_head *head, struct cds_list_head *entry)
 {
-	if (list_empty(head))
+	if (cds_list_empty(head))
 		return;
 	if (list_is_singular(head) &&
 		(head->next != entry && head != entry))
 		return;
 	if (entry == head)
-		INIT_LIST_HEAD(list);
+		CDS_INIT_LIST_HEAD(list);
 	else
 		__list_cut_position(list, head, entry);
 }
 
-static inline void __list_splice(const struct list_head *list,
-				 struct list_head *prev,
-				 struct list_head *next)
+static inline void __cds_list_splice(const struct cds_list_head *list,
+				 struct cds_list_head *prev,
+				 struct cds_list_head *next)
 {
-	struct list_head *first = list->next;
-	struct list_head *last = list->prev;
+	struct cds_list_head *first = list->next;
+	struct cds_list_head *last = list->prev;
 
 	first->prev = prev;
 	prev->next = first;
@@ -971,69 +971,69 @@ static inline void __list_splice(const struct list_head *list,
 }
 
 /**
- * list_splice - join two lists, this is designed for stacks
+ * cds_list_splice - join two lists, this is designed for stacks
  * @list: the new list to add.
  * @head: the place to add it in the first list.
  */
-static inline void list_splice(const struct list_head *list,
-				struct list_head *head)
+static inline void cds_list_splice(const struct cds_list_head *list,
+				struct cds_list_head *head)
 {
-	if (!list_empty(list))
-		__list_splice(list, head, head->next);
+	if (!cds_list_empty(list))
+		__cds_list_splice(list, head, head->next);
 }
 
 /**
- * list_splice_tail - join two lists, each list being a queue
+ * cds_list_splice_tail - join two lists, each list being a queue
  * @list: the new list to add.
  * @head: the place to add it in the first list.
  */
-static inline void list_splice_tail(struct list_head *list,
-				struct list_head *head)
+static inline void cds_list_splice_tail(struct cds_list_head *list,
+				struct cds_list_head *head)
 {
-	if (!list_empty(list))
-		__list_splice(list, head->prev, head);
+	if (!cds_list_empty(list))
+		__cds_list_splice(list, head->prev, head);
 }
 
 /**
- * list_splice_init - join two lists and reinitialise the emptied list.
+ * cds_list_splice_init - join two lists and reinitialise the emptied list.
  * @list: the new list to add.
  * @head: the place to add it in the first list.
  *
  * The list at @list is reinitialised
  */
-static inline void list_splice_init(struct list_head *list,
-				    struct list_head *head)
+static inline void cds_list_splice_init(struct cds_list_head *list,
+				    struct cds_list_head *head)
 {
-	if (!list_empty(list)) {
-		__list_splice(list, head, head->next);
-		INIT_LIST_HEAD(list);
+	if (!cds_list_empty(list)) {
+		__cds_list_splice(list, head, head->next);
+		CDS_INIT_LIST_HEAD(list);
 	}
 }
 
 /**
- * list_splice_tail_init - join two lists and reinitialise the emptied list
+ * cds_list_splice_tail_init - join two lists and reinitialise the emptied list
  * @list: the new list to add.
  * @head: the place to add it in the first list.
  *
  * Each of the lists is a queue.
  * The list at @list is reinitialised
  */
-static inline void list_splice_tail_init(struct list_head *list,
-					 struct list_head *head)
+static inline void cds_list_splice_tail_init(struct cds_list_head *list,
+					 struct cds_list_head *head)
 {
-	if (!list_empty(list)) {
-		__list_splice(list, head->prev, head);
-		INIT_LIST_HEAD(list);
+	if (!cds_list_empty(list)) {
+		__cds_list_splice(list, head->prev, head);
+		CDS_INIT_LIST_HEAD(list);
 	}
 }
 
 /**
- * list_entry - get the struct for this entry
- * @ptr:	the &struct list_head pointer.
+ * cds_list_entry - get the struct for this entry
+ * @ptr:	the &struct cds_list_head pointer.
  * @type:	the type of the struct this is embedded in.
  * @member:	the name of the list_struct within the struct.
  */
-#define list_entry(ptr, type, member) \
+#define cds_list_entry(ptr, type, member) \
 	caa_container_of(ptr, type, member)
 
 /**
@@ -1045,95 +1045,95 @@ static inline void list_splice_tail_init(struct list_head *list,
  * Note, that list is expected to be not empty.
  */
 #define list_first_entry(ptr, type, member) \
-	list_entry((ptr)->next, type, member)
+	cds_list_entry((ptr)->next, type, member)
 
 /**
- * list_for_each	-	iterate over a list
- * @pos:	the &struct list_head to use as a loop cursor.
+ * cds_list_for_each	-	iterate over a list
+ * @pos:	the &struct cds_list_head to use as a loop cursor.
  * @head:	the head for your list.
  */
-#define list_for_each(pos, head) \
+#define cds_list_for_each(pos, head) \
 	for (pos = (head)->next; prefetch(pos->next), pos != (head); \
         	pos = pos->next)
 
 /**
- * __list_for_each	-	iterate over a list
- * @pos:	the &struct list_head to use as a loop cursor.
+ * __cds_list_for_each	-	iterate over a list
+ * @pos:	the &struct cds_list_head to use as a loop cursor.
  * @head:	the head for your list.
  *
- * This variant differs from list_for_each() in that it's the
+ * This variant differs from cds_list_for_each() in that it's the
  * simplest possible list iteration code, no prefetching is done.
  * Use this for code that knows the list to be very short (empty
  * or 1 entry) most of the time.
  */
-#define __list_for_each(pos, head) \
+#define __cds_list_for_each(pos, head) \
 	for (pos = (head)->next; pos != (head); pos = pos->next)
 
 /**
- * list_for_each_prev	-	iterate over a list backwards
- * @pos:	the &struct list_head to use as a loop cursor.
+ * cds_list_for_each_prev	-	iterate over a list backwards
+ * @pos:	the &struct cds_list_head to use as a loop cursor.
  * @head:	the head for your list.
  */
-#define list_for_each_prev(pos, head) \
+#define cds_list_for_each_prev(pos, head) \
 	for (pos = (head)->prev; prefetch(pos->prev), pos != (head); \
         	pos = pos->prev)
 
 /**
- * list_for_each_safe - iterate over a list safe against removal of list entry
- * @pos:	the &struct list_head to use as a loop cursor.
- * @n:		another &struct list_head to use as temporary storage
+ * cds_list_for_each_safe - iterate over a list safe against removal of list entry
+ * @pos:	the &struct cds_list_head to use as a loop cursor.
+ * @n:		another &struct cds_list_head to use as temporary storage
  * @head:	the head for your list.
  */
-#define list_for_each_safe(pos, n, head) \
+#define cds_list_for_each_safe(pos, n, head) \
 	for (pos = (head)->next, n = pos->next; pos != (head); \
 		pos = n, n = pos->next)
 
 /**
- * list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
- * @pos:	the &struct list_head to use as a loop cursor.
- * @n:		another &struct list_head to use as temporary storage
+ * cds_list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
+ * @pos:	the &struct cds_list_head to use as a loop cursor.
+ * @n:		another &struct cds_list_head to use as temporary storage
  * @head:	the head for your list.
  */
-#define list_for_each_prev_safe(pos, n, head) \
+#define cds_list_for_each_prev_safe(pos, n, head) \
 	for (pos = (head)->prev, n = pos->prev; \
 	     prefetch(pos->prev), pos != (head); \
 	     pos = n, n = pos->prev)
 
 /**
- * list_for_each_entry	-	iterate over list of given type
+ * cds_list_for_each_entry	-	iterate over list of given type
  * @pos:	the type * to use as a loop cursor.
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
  */
-#define list_for_each_entry(pos, head, member)				\
-	for (pos = list_entry((head)->next, typeof(*pos), member);	\
+#define cds_list_for_each_entry(pos, head, member)				\
+	for (pos = cds_list_entry((head)->next, typeof(*pos), member);	\
 	     prefetch(pos->member.next), &pos->member != (head); 	\
-	     pos = list_entry(pos->member.next, typeof(*pos), member))
+	     pos = cds_list_entry(pos->member.next, typeof(*pos), member))
 
 /**
- * list_for_each_entry_reverse - iterate backwards over list of given type.
+ * cds_list_for_each_entry_reverse - iterate backwards over list of given type.
  * @pos:	the type * to use as a loop cursor.
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
  */
-#define list_for_each_entry_reverse(pos, head, member)			\
-	for (pos = list_entry((head)->prev, typeof(*pos), member);	\
+#define cds_list_for_each_entry_reverse(pos, head, member)			\
+	for (pos = cds_list_entry((head)->prev, typeof(*pos), member);	\
 	     prefetch(pos->member.prev), &pos->member != (head); 	\
-	     pos = list_entry(pos->member.prev, typeof(*pos), member))
+	     pos = cds_list_entry(pos->member.prev, typeof(*pos), member))
 
 /**
- * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue()
+ * list_prepare_entry - prepare a pos entry for use in cds_list_for_each_entry_continue()
  * @pos:	the type * to use as a start point
  * @head:	the head of the list
  * @member:	the name of the list_struct within the struct.
  *
- * Prepares a pos entry for use as a start point in list_for_each_entry_continue().
+ * Prepares a pos entry for use as a start point in cds_list_for_each_entry_continue().
  */
 #define list_prepare_entry(pos, head, member) \
-	((pos) ? : list_entry(head, typeof(*pos), member))
+	((pos) ? : cds_list_entry(head, typeof(*pos), member))
 
 /**
- * list_for_each_entry_continue - continue iteration over list of given type
+ * cds_list_for_each_entry_continue - continue iteration over list of given type
  * @pos:	the type * to use as a loop cursor.
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
@@ -1141,13 +1141,13 @@ static inline void list_splice_tail_init(struct list_head *list,
  * Continue to iterate over list of given type, continuing after
  * the current position.
  */
-#define list_for_each_entry_continue(pos, head, member) 		\
-	for (pos = list_entry(pos->member.next, typeof(*pos), member);	\
+#define cds_list_for_each_entry_continue(pos, head, member) 		\
+	for (pos = cds_list_entry(pos->member.next, typeof(*pos), member);	\
 	     prefetch(pos->member.next), &pos->member != (head);	\
-	     pos = list_entry(pos->member.next, typeof(*pos), member))
+	     pos = cds_list_entry(pos->member.next, typeof(*pos), member))
 
 /**
- * list_for_each_entry_continue_reverse - iterate backwards from the given point
+ * cds_list_for_each_entry_continue_reverse - iterate backwards from the given point
  * @pos:	the type * to use as a loop cursor.
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
@@ -1155,38 +1155,38 @@ static inline void list_splice_tail_init(struct list_head *list,
  * Start to iterate over list of given type backwards, continuing after
  * the current position.
  */
-#define list_for_each_entry_continue_reverse(pos, head, member)		\
-	for (pos = list_entry(pos->member.prev, typeof(*pos), member);	\
+#define cds_list_for_each_entry_continue_reverse(pos, head, member)		\
+	for (pos = cds_list_entry(pos->member.prev, typeof(*pos), member);	\
 	     prefetch(pos->member.prev), &pos->member != (head);	\
-	     pos = list_entry(pos->member.prev, typeof(*pos), member))
+	     pos = cds_list_entry(pos->member.prev, typeof(*pos), member))
 
 /**
- * list_for_each_entry_from - iterate over list of given type from the current point
+ * cds_list_for_each_entry_from - iterate over list of given type from the current point
  * @pos:	the type * to use as a loop cursor.
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
  *
  * Iterate over list of given type, continuing from current position.
  */
-#define list_for_each_entry_from(pos, head, member) 			\
+#define cds_list_for_each_entry_from(pos, head, member) 			\
 	for (; prefetch(pos->member.next), &pos->member != (head);	\
-	     pos = list_entry(pos->member.next, typeof(*pos), member))
+	     pos = cds_list_entry(pos->member.next, typeof(*pos), member))
 
 /**
- * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
+ * cds_list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
  * @pos:	the type * to use as a loop cursor.
  * @n:		another type * to use as temporary storage
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
  */
-#define list_for_each_entry_safe(pos, n, head, member)			\
-	for (pos = list_entry((head)->next, typeof(*pos), member),	\
-		n = list_entry(pos->member.next, typeof(*pos), member);	\
+#define cds_list_for_each_entry_safe(pos, n, head, member)			\
+	for (pos = cds_list_entry((head)->next, typeof(*pos), member),	\
+		n = cds_list_entry(pos->member.next, typeof(*pos), member);	\
 	     &pos->member != (head); 					\
-	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
+	     pos = n, n = cds_list_entry(n->member.next, typeof(*n), member))
 
 /**
- * list_for_each_entry_safe_continue
+ * cds_list_for_each_entry_safe_continue
  * @pos:	the type * to use as a loop cursor.
  * @n:		another type * to use as temporary storage
  * @head:	the head for your list.
@@ -1195,14 +1195,14 @@ static inline void list_splice_tail_init(struct list_head *list,
  * Iterate over list of given type, continuing after current point,
  * safe against removal of list entry.
  */
-#define list_for_each_entry_safe_continue(pos, n, head, member) 		\
-	for (pos = list_entry(pos->member.next, typeof(*pos), member), 		\
-		n = list_entry(pos->member.next, typeof(*pos), member);		\
+#define cds_list_for_each_entry_safe_continue(pos, n, head, member) 		\
+	for (pos = cds_list_entry(pos->member.next, typeof(*pos), member), 		\
+		n = cds_list_entry(pos->member.next, typeof(*pos), member);		\
 	     &pos->member != (head);						\
-	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
+	     pos = n, n = cds_list_entry(n->member.next, typeof(*n), member))
 
 /**
- * list_for_each_entry_safe_from
+ * cds_list_for_each_entry_safe_from
  * @pos:	the type * to use as a loop cursor.
  * @n:		another type * to use as temporary storage
  * @head:	the head for your list.
@@ -1211,13 +1211,13 @@ static inline void list_splice_tail_init(struct list_head *list,
  * Iterate over list of given type from current point, safe against
  * removal of list entry.
  */
-#define list_for_each_entry_safe_from(pos, n, head, member) 			\
-	for (n = list_entry(pos->member.next, typeof(*pos), member);		\
+#define cds_list_for_each_entry_safe_from(pos, n, head, member) 			\
+	for (n = cds_list_entry(pos->member.next, typeof(*pos), member);		\
 	     &pos->member != (head);						\
-	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
+	     pos = n, n = cds_list_entry(n->member.next, typeof(*n), member))
 
 /**
- * list_for_each_entry_safe_reverse
+ * cds_list_for_each_entry_safe_reverse
  * @pos:	the type * to use as a loop cursor.
  * @n:		another type * to use as temporary storage
  * @head:	the head for your list.
@@ -1226,11 +1226,11 @@ static inline void list_splice_tail_init(struct list_head *list,
  * Iterate backwards over list of given type, safe against removal
  * of list entry.
  */
-#define list_for_each_entry_safe_reverse(pos, n, head, member)		\
-	for (pos = list_entry((head)->prev, typeof(*pos), member),	\
-		n = list_entry(pos->member.prev, typeof(*pos), member);	\
+#define cds_list_for_each_entry_safe_reverse(pos, n, head, member)		\
+	for (pos = cds_list_entry((head)->prev, typeof(*pos), member),	\
+		n = cds_list_entry(pos->member.prev, typeof(*pos), member);	\
 	     &pos->member != (head); 					\
-	     pos = n, n = list_entry(n->member.prev, typeof(*n), member))
+	     pos = n, n = cds_list_entry(n->member.prev, typeof(*n), member))
 
 #endif //0
 
@@ -1241,60 +1241,60 @@ static inline void list_splice_tail_init(struct list_head *list,
  * You lose the ability to access the tail in O(1).
  */
 
-struct hlist_head {
-	struct hlist_node *first;
+struct cds_hlist_head {
+	struct cds_hlist_node *first;
 };
 
-struct hlist_node {
-	struct hlist_node *next, **pprev;
+struct cds_hlist_node {
+	struct cds_hlist_node *next, **pprev;
 };
 
 #define HLIST_HEAD_INIT { .first = NULL }
-#define HLIST_HEAD(name) struct hlist_head name = {  .first = NULL }
-#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL)
-static inline void INIT_HLIST_NODE(struct hlist_node *h)
+#define HLIST_HEAD(name) struct cds_hlist_head name = {  .first = NULL }
+#define CDS_INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL)
+static inline void INIT_HLIST_NODE(struct cds_hlist_node *h)
 {
 	h->next = NULL;
 	h->pprev = NULL;
 }
 
-static inline int hlist_unhashed(const struct hlist_node *h)
+static inline int hlist_unhashed(const struct cds_hlist_node *h)
 {
 	return !h->pprev;
 }
 
-static inline int hlist_empty(const struct hlist_head *h)
+static inline int hlist_empty(const struct cds_hlist_head *h)
 {
 	return !h->first;
 }
 
-static inline void __hlist_del(struct hlist_node *n)
+static inline void __cds_hlist_del(struct cds_hlist_node *n)
 {
-	struct hlist_node *next = n->next;
-	struct hlist_node **pprev = n->pprev;
+	struct cds_hlist_node *next = n->next;
+	struct cds_hlist_node **pprev = n->pprev;
 	*pprev = next;
 	if (next)
 		next->pprev = pprev;
 }
 
-static inline void hlist_del(struct hlist_node *n)
+static inline void cds_hlist_del(struct cds_hlist_node *n)
 {
-	__hlist_del(n);
+	__cds_hlist_del(n);
 	n->next = LIST_POISON1;
 	n->pprev = LIST_POISON2;
 }
 
-static inline void hlist_del_init(struct hlist_node *n)
+static inline void cds_hlist_del_init(struct cds_hlist_node *n)
 {
 	if (!hlist_unhashed(n)) {
-		__hlist_del(n);
+		__cds_hlist_del(n);
 		INIT_HLIST_NODE(n);
 	}
 }
 
-static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
+static inline void cds_hlist_add_head(struct cds_hlist_node *n, struct cds_hlist_head *h)
 {
-	struct hlist_node *first = h->first;
+	struct cds_hlist_node *first = h->first;
 	n->next = first;
 	if (first)
 		first->pprev = &n->next;
@@ -1303,8 +1303,8 @@ static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
 }
 
 /* next must be != NULL */
-static inline void hlist_add_before(struct hlist_node *n,
-					struct hlist_node *next)
+static inline void hlist_add_before(struct cds_hlist_node *n,
+					struct cds_hlist_node *next)
 {
 	n->pprev = next->pprev;
 	n->next = next;
@@ -1312,8 +1312,8 @@ static inline void hlist_add_before(struct hlist_node *n,
 	*(n->pprev) = n;
 }
 
-static inline void hlist_add_after(struct hlist_node *n,
-					struct hlist_node *next)
+static inline void hlist_add_after(struct cds_hlist_node *n,
+					struct cds_hlist_node *next)
 {
 	next->next = n->next;
 	n->next = next;
@@ -1327,8 +1327,8 @@ static inline void hlist_add_after(struct hlist_node *n,
  * Move a list from one list head to another. Fixup the pprev
  * reference of the first entry if it exists.
  */
-static inline void hlist_move_list(struct hlist_head *old,
-				   struct hlist_head *new)
+static inline void hlist_move_list(struct cds_hlist_head *old,
+				   struct cds_hlist_head *new)
 {
 	new->first = old->first;
 	if (new->first)
@@ -1336,64 +1336,64 @@ static inline void hlist_move_list(struct hlist_head *old,
 	old->first = NULL;
 }
 
-#define hlist_entry(ptr, type, member) caa_container_of(ptr,type,member)
+#define cds_hlist_entry(ptr, type, member) caa_container_of(ptr,type,member)
 
-#define hlist_for_each(pos, head) \
+#define cds_hlist_for_each(pos, head) \
 	for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \
 	     pos = pos->next)
 
-#define hlist_for_each_safe(pos, n, head) \
+#define cds_hlist_for_each_safe(pos, n, head) \
 	for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
 	     pos = n)
 
 /**
- * hlist_for_each_entry	- iterate over list of given type
+ * cds_hlist_for_each_entry	- iterate over list of given type
  * @tpos:	the type * to use as a loop cursor.
- * @pos:	the &struct hlist_node to use as a loop cursor.
+ * @pos:	the &struct cds_hlist_node to use as a loop cursor.
  * @head:	the head for your list.
- * @member:	the name of the hlist_node within the struct.
+ * @member:	the name of the cds_hlist_node within the struct.
  */
-#define hlist_for_each_entry(tpos, pos, head, member)			 \
+#define cds_hlist_for_each_entry(tpos, pos, head, member)			 \
 	for (pos = (head)->first;					 \
 	     pos && ({ prefetch(pos->next); 1;}) &&			 \
-		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+		({ tpos = cds_hlist_entry(pos, typeof(*tpos), member); 1;}); \
 	     pos = pos->next)
 
 /**
- * hlist_for_each_entry_continue - iterate over a hlist continuing after current point
+ * cds_hlist_for_each_entry_continue - iterate over a hlist continuing after current point
  * @tpos:	the type * to use as a loop cursor.
- * @pos:	the &struct hlist_node to use as a loop cursor.
- * @member:	the name of the hlist_node within the struct.
+ * @pos:	the &struct cds_hlist_node to use as a loop cursor.
+ * @member:	the name of the cds_hlist_node within the struct.
  */
-#define hlist_for_each_entry_continue(tpos, pos, member)		 \
+#define cds_hlist_for_each_entry_continue(tpos, pos, member)		 \
 	for (pos = (pos)->next;						 \
 	     pos && ({ prefetch(pos->next); 1;}) &&			 \
-		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+		({ tpos = cds_hlist_entry(pos, typeof(*tpos), member); 1;}); \
 	     pos = pos->next)
 
 /**
- * hlist_for_each_entry_from - iterate over a hlist continuing from current point
+ * cds_hlist_for_each_entry_from - iterate over a hlist continuing from current point
  * @tpos:	the type * to use as a loop cursor.
- * @pos:	the &struct hlist_node to use as a loop cursor.
- * @member:	the name of the hlist_node within the struct.
+ * @pos:	the &struct cds_hlist_node to use as a loop cursor.
+ * @member:	the name of the cds_hlist_node within the struct.
  */
-#define hlist_for_each_entry_from(tpos, pos, member)			 \
+#define cds_hlist_for_each_entry_from(tpos, pos, member)			 \
 	for (; pos && ({ prefetch(pos->next); 1;}) &&			 \
-		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+		({ tpos = cds_hlist_entry(pos, typeof(*tpos), member); 1;}); \
 	     pos = pos->next)
 
 /**
- * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
+ * cds_hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
  * @tpos:	the type * to use as a loop cursor.
- * @pos:	the &struct hlist_node to use as a loop cursor.
- * @n:		another &struct hlist_node to use as temporary storage
+ * @pos:	the &struct cds_hlist_node to use as a loop cursor.
+ * @n:		another &struct cds_hlist_node to use as temporary storage
  * @head:	the head for your list.
- * @member:	the name of the hlist_node within the struct.
+ * @member:	the name of the cds_hlist_node within the struct.
  */
-#define hlist_for_each_entry_safe(tpos, pos, n, head, member) 		 \
+#define cds_hlist_for_each_entry_safe(tpos, pos, n, head, member) 		 \
 	for (pos = (head)->first;					 \
 	     pos && ({ n = pos->next; 1; }) && 				 \
-		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+		({ tpos = cds_hlist_entry(pos, typeof(*tpos), member); 1;}); \
 	     pos = n)
 
 #endif
diff --git a/tests/test_urcu_lfq.c b/tests/test_urcu_lfq.c
index aed9be0..de7c8a3 100644
--- a/tests/test_urcu_lfq.c
+++ b/tests/test_urcu_lfq.c
@@ -154,7 +154,7 @@ static unsigned long long __thread nr_successful_enqueues;
 static unsigned int nr_enqueuers;
 static unsigned int nr_dequeuers;
 
-static struct rcu_lfq_queue q;
+static struct cds_lfq_queue_rcu q;
 
 void *thr_enqueuer(void *_count)
 {
@@ -173,11 +173,11 @@ void *thr_enqueuer(void *_count)
 	cmm_smp_mb();
 
 	for (;;) {
-		struct rcu_lfq_node *node = malloc(sizeof(*node));
+		struct cds_lfq_node_rcu *node = malloc(sizeof(*node));
 		if (!node)
 			goto fail;
-		rcu_lfq_node_init(node);
-		rcu_lfq_enqueue(&q, node);
+		cds_lfq_node_init_rcu(node);
+		cds_lfq_enqueue_rcu(&q, node);
 		nr_successful_enqueues++;
 
 		if (unlikely(wdelay))
@@ -202,7 +202,7 @@ fail:
 
 static void rcu_release_node(struct urcu_ref *ref)
 {
-	struct rcu_lfq_node *node = caa_container_of(ref, struct rcu_lfq_node, ref);
+	struct cds_lfq_node_rcu *node = caa_container_of(ref, struct cds_lfq_node_rcu, ref);
 	defer_rcu(free, node);
 	//synchronize_rcu();
 	//free(node);
@@ -226,7 +226,7 @@ void *thr_dequeuer(void *_count)
 	cmm_smp_mb();
 
 	for (;;) {
-		struct rcu_lfq_node *node = rcu_lfq_dequeue(&q,
+		struct cds_lfq_node_rcu *node = cds_lfq_dequeue_rcu(&q,
 							    rcu_release_node);
 
 		if (node) {
@@ -255,16 +255,16 @@ void *thr_dequeuer(void *_count)
 
 static void release_node(struct urcu_ref *ref)
 {
-	struct rcu_lfq_node *node = caa_container_of(ref, struct rcu_lfq_node, ref);
+	struct cds_lfq_node_rcu *node = caa_container_of(ref, struct cds_lfq_node_rcu, ref);
 	free(node);
 }
 
-void test_end(struct rcu_lfq_queue *q, unsigned long long *nr_dequeues)
+void test_end(struct cds_lfq_queue_rcu *q, unsigned long long *nr_dequeues)
 {
-	struct rcu_lfq_node *node;
+	struct cds_lfq_node_rcu *node;
 
 	do {
-		node = rcu_lfq_dequeue(q, release_node);
+		node = cds_lfq_dequeue_rcu(q, release_node);
 		if (node) {
 			urcu_ref_put(&node->ref, release_node);
 			(*nr_dequeues)++;
@@ -363,7 +363,7 @@ int main(int argc, char **argv)
 	tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);
 	count_enqueuer = malloc(2 * sizeof(*count_enqueuer) * nr_enqueuers);
 	count_dequeuer = malloc(2 * sizeof(*count_dequeuer) * nr_dequeuers);
-	rcu_lfq_init(&q);
+	cds_lfq_init_rcu(&q);
 
 	next_aff = 0;
 
diff --git a/tests/test_urcu_lfs.c b/tests/test_urcu_lfs.c
index 02be2d4..8335f24 100644
--- a/tests/test_urcu_lfs.c
+++ b/tests/test_urcu_lfs.c
@@ -154,7 +154,7 @@ static unsigned long long __thread nr_successful_enqueues;
 static unsigned int nr_enqueuers;
 static unsigned int nr_dequeuers;
 
-static struct rcu_lfs_stack s;
+static struct cds_lfs_stack_rcu s;
 
 void *thr_enqueuer(void *_count)
 {
@@ -173,11 +173,11 @@ void *thr_enqueuer(void *_count)
 	cmm_smp_mb();
 
 	for (;;) {
-		struct rcu_lfs_node *node = malloc(sizeof(*node));
+		struct cds_lfs_node_rcu *node = malloc(sizeof(*node));
 		if (!node)
 			goto fail;
-		rcu_lfs_node_init(node);
-		rcu_lfs_push(&s, node);
+		cds_lfs_node_init_rcu(node);
+		cds_lfs_push_rcu(&s, node);
 		nr_successful_enqueues++;
 
 		if (unlikely(wdelay))
@@ -218,7 +218,7 @@ void *thr_dequeuer(void *_count)
 	cmm_smp_mb();
 
 	for (;;) {
-		struct rcu_lfs_node *node = rcu_lfs_pop(&s);
+		struct cds_lfs_node_rcu *node = cds_lfs_pop_rcu(&s);
 
 		if (node) {
 			defer_rcu(free, node);
@@ -244,12 +244,12 @@ void *thr_dequeuer(void *_count)
 	return ((void*)2);
 }
 
-void test_end(struct rcu_lfs_stack *s, unsigned long long *nr_dequeues)
+void test_end(struct cds_lfs_stack_rcu *s, unsigned long long *nr_dequeues)
 {
-	struct rcu_lfs_node *node;
+	struct cds_lfs_node_rcu *node;
 
 	do {
-		node = rcu_lfs_pop(s);
+		node = cds_lfs_pop_rcu(s);
 		if (node) {
 			free(node);
 			(*nr_dequeues)++;
@@ -348,7 +348,7 @@ int main(int argc, char **argv)
 	tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);
 	count_enqueuer = malloc(2 * sizeof(*count_enqueuer) * nr_enqueuers);
 	count_dequeuer = malloc(2 * sizeof(*count_dequeuer) * nr_dequeuers);
-	rcu_lfs_init(&s);
+	cds_lfs_init_rcu(&s);
 
 	next_aff = 0;
 
diff --git a/tests/test_urcu_wfq.c b/tests/test_urcu_wfq.c
index cb49454..bcdd4c0 100644
--- a/tests/test_urcu_wfq.c
+++ b/tests/test_urcu_wfq.c
@@ -153,7 +153,7 @@ static unsigned long long __thread nr_successful_enqueues;
 static unsigned int nr_enqueuers;
 static unsigned int nr_dequeuers;
 
-static struct wfq_queue q;
+static struct cds_wfq_queue q;
 
 void *thr_enqueuer(void *_count)
 {
@@ -170,11 +170,11 @@ void *thr_enqueuer(void *_count)
 	cmm_smp_mb();
 
 	for (;;) {
-		struct wfq_node *node = malloc(sizeof(*node));
+		struct cds_wfq_node *node = malloc(sizeof(*node));
 		if (!node)
 			goto fail;
-		wfq_node_init(node);
-		wfq_enqueue(&q, node);
+		cds_wfq_node_init(node);
+		cds_wfq_enqueue(&q, node);
 		nr_successful_enqueues++;
 
 		if (unlikely(wdelay))
@@ -210,7 +210,7 @@ void *thr_dequeuer(void *_count)
 	cmm_smp_mb();
 
 	for (;;) {
-		struct wfq_node *node = wfq_dequeue_blocking(&q);
+		struct cds_wfq_node *node = cds_wfq_dequeue_blocking(&q);
 
 		if (node) {
 			free(node);
@@ -233,12 +233,12 @@ void *thr_dequeuer(void *_count)
 	return ((void*)2);
 }
 
-void test_end(struct wfq_queue *q, unsigned long long *nr_dequeues)
+void test_end(struct cds_wfq_queue *q, unsigned long long *nr_dequeues)
 {
-	struct wfq_node *node;
+	struct cds_wfq_node *node;
 
 	do {
-		node = wfq_dequeue_blocking(q);
+		node = cds_wfq_dequeue_blocking(q);
 		if (node) {
 			free(node);
 			(*nr_dequeues)++;
@@ -337,7 +337,7 @@ int main(int argc, char **argv)
 	tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);
 	count_enqueuer = malloc(2 * sizeof(*count_enqueuer) * nr_enqueuers);
 	count_dequeuer = malloc(2 * sizeof(*count_dequeuer) * nr_dequeuers);
-	wfq_init(&q);
+	cds_wfq_init(&q);
 
 	next_aff = 0;
 
diff --git a/tests/test_urcu_wfs.c b/tests/test_urcu_wfs.c
index 49f9218..dc45700 100644
--- a/tests/test_urcu_wfs.c
+++ b/tests/test_urcu_wfs.c
@@ -153,7 +153,7 @@ static unsigned long long __thread nr_successful_enqueues;
 static unsigned int nr_enqueuers;
 static unsigned int nr_dequeuers;
 
-static struct wfs_stack s;
+static struct cds_wfs_stack s;
 
 void *thr_enqueuer(void *_count)
 {
@@ -170,11 +170,11 @@ void *thr_enqueuer(void *_count)
 	cmm_smp_mb();
 
 	for (;;) {
-		struct wfs_node *node = malloc(sizeof(*node));
+		struct cds_wfs_node *node = malloc(sizeof(*node));
 		if (!node)
 			goto fail;
-		wfs_node_init(node);
-		wfs_push(&s, node);
+		cds_wfs_node_init(node);
+		cds_wfs_push(&s, node);
 		nr_successful_enqueues++;
 
 		if (unlikely(wdelay))
@@ -210,7 +210,7 @@ void *thr_dequeuer(void *_count)
 	cmm_smp_mb();
 
 	for (;;) {
-		struct wfs_node *node = wfs_pop_blocking(&s);
+		struct cds_wfs_node *node = cds_wfs_pop_blocking(&s);
 
 		if (node) {
 			free(node);
@@ -233,12 +233,12 @@ void *thr_dequeuer(void *_count)
 	return ((void*)2);
 }
 
-void test_end(struct wfs_stack *s, unsigned long long *nr_dequeues)
+void test_end(struct cds_wfs_stack *s, unsigned long long *nr_dequeues)
 {
-	struct wfs_node *node;
+	struct cds_wfs_node *node;
 
 	do {
-		node = wfs_pop_blocking(s);
+		node = cds_wfs_pop_blocking(s);
 		if (node) {
 			free(node);
 			(*nr_dequeues)++;
@@ -337,7 +337,7 @@ int main(int argc, char **argv)
 	tid_dequeuer = malloc(sizeof(*tid_dequeuer) * nr_dequeuers);
 	count_enqueuer = malloc(2 * sizeof(*count_enqueuer) * nr_enqueuers);
 	count_dequeuer = malloc(2 * sizeof(*count_dequeuer) * nr_dequeuers);
-	wfs_init(&s);
+	cds_wfs_init(&s);
 
 	next_aff = 0;
 
diff --git a/urcu-bp-static.h b/urcu-bp-static.h
index ea2c376..2049ee6 100644
--- a/urcu-bp-static.h
+++ b/urcu-bp-static.h
@@ -140,7 +140,7 @@ struct rcu_reader {
 	/* Data used by both reader and synchronize_rcu() */
 	long ctr;
 	/* Data used for registry */
-	struct list_head node __attribute__((aligned(CAA_CACHE_LINE_SIZE)));
+	struct cds_list_head node __attribute__((aligned(CAA_CACHE_LINE_SIZE)));
 	pthread_t tid;
 	int alloc;	/* registry entry allocated */
 };
diff --git a/urcu-bp.c b/urcu-bp.c
index b457d2b..136f97d 100644
--- a/urcu-bp.c
+++ b/urcu-bp.c
@@ -66,7 +66,7 @@ long rcu_gp_ctr = RCU_GP_COUNT;
  */
 struct rcu_reader __thread *rcu_reader;
 
-static LIST_HEAD(registry);
+static CDS_LIST_HEAD(registry);
 
 struct registry_arena {
 	void *p;
@@ -118,7 +118,7 @@ static void mutex_unlock(pthread_mutex_t *mutex)
 
 void update_counter_and_wait(void)
 {
-	LIST_HEAD(qsreaders);
+	CDS_LIST_HEAD(qsreaders);
 	int wait_loops = 0;
 	struct rcu_reader *index, *tmp;
 
@@ -144,12 +144,12 @@ void update_counter_and_wait(void)
 	 */
 	for (;;) {
 		wait_loops++;
-		list_for_each_entry_safe(index, tmp, &registry, node) {
+		cds_list_for_each_entry_safe(index, tmp, &registry, node) {
 			if (!rcu_old_gp_ongoing(&index->ctr))
-				list_move(&index->node, &qsreaders);
+				cds_list_move(&index->node, &qsreaders);
 		}
 
-		if (list_empty(&registry)) {
+		if (cds_list_empty(&registry)) {
 			break;
 		} else {
 			if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS)
@@ -159,7 +159,7 @@ void update_counter_and_wait(void)
 		}
 	}
 	/* put back the reader list in the registry */
-	list_splice(&qsreaders, &registry);
+	cds_list_splice(&qsreaders, &registry);
 }
 
 void synchronize_rcu(void)
@@ -174,7 +174,7 @@ void synchronize_rcu(void)
 
 	mutex_lock(&rcu_gp_lock);
 
-	if (list_empty(&registry))
+	if (cds_list_empty(&registry))
 		goto out;
 
 	/* All threads should read qparity before accessing data structure
@@ -279,7 +279,7 @@ static void add_thread(void)
 	/* Add to registry */
 	rcu_reader_reg->tid = pthread_self();
 	assert(rcu_reader_reg->ctr == 0);
-	list_add(&rcu_reader_reg->node, &registry);
+	cds_list_add(&rcu_reader_reg->node, &registry);
 	rcu_reader = rcu_reader_reg;
 }
 
@@ -299,7 +299,7 @@ static void rcu_gc_registry(void)
 		ret = pthread_kill(tid, 0);
 		assert(ret != EINVAL);
 		if (ret == ESRCH) {
-			list_del(&rcu_reader_reg->node);
+			cds_list_del(&rcu_reader_reg->node);
 			rcu_reader_reg->ctr = 0;
 			rcu_reader_reg->alloc = 0;
 			registry_arena.used -= sizeof(struct rcu_reader);
diff --git a/urcu-defer-static.h b/urcu-defer-static.h
index 1e2aef2..3e5df3e 100644
--- a/urcu-defer-static.h
+++ b/urcu-defer-static.h
@@ -98,7 +98,7 @@ struct defer_queue {
 	void **q;
 	/* registry information */
 	unsigned long last_head;
-	struct list_head list;	/* list of thread queues */
+	struct cds_list_head list;	/* list of thread queues */
 };
 
 #ifdef __cplusplus 
diff --git a/urcu-defer.c b/urcu-defer.c
index c28e848..796e7e1 100644
--- a/urcu-defer.c
+++ b/urcu-defer.c
@@ -54,7 +54,7 @@ static int defer_thread_futex;
  * the reclamation tread.
  */
 static struct defer_queue __thread defer_queue;
-static LIST_HEAD(registry);
+static CDS_LIST_HEAD(registry);
 static pthread_t tid_defer;
 
 static void mutex_lock(pthread_mutex_t *mutex)
@@ -109,7 +109,7 @@ static unsigned long rcu_defer_num_callbacks(void)
 	struct defer_queue *index;
 
 	mutex_lock(&rcu_defer_mutex);
-	list_for_each_entry(index, &registry, list) {
+	cds_list_for_each_entry(index, &registry, list) {
 		head = CAA_LOAD_SHARED(index->head);
 		num_items += head - index->tail;
 	}
@@ -207,11 +207,11 @@ void rcu_defer_barrier(void)
 	struct defer_queue *index;
 	unsigned long num_items = 0;
 
-	if (list_empty(&registry))
+	if (cds_list_empty(&registry))
 		return;
 
 	mutex_lock(&rcu_defer_mutex);
-	list_for_each_entry(index, &registry, list) {
+	cds_list_for_each_entry(index, &registry, list) {
 		index->last_head = CAA_LOAD_SHARED(index->head);
 		num_items += index->last_head - index->tail;
 	}
@@ -223,7 +223,7 @@ void rcu_defer_barrier(void)
 		goto end;
 	}
 	synchronize_rcu();
-	list_for_each_entry(index, &registry, list)
+	cds_list_for_each_entry(index, &registry, list)
 		rcu_defer_barrier_queue(index, index->last_head);
 end:
 	mutex_unlock(&rcu_defer_mutex);
@@ -349,8 +349,8 @@ void rcu_defer_register_thread(void)
 
 	mutex_lock(&defer_thread_mutex);
 	mutex_lock(&rcu_defer_mutex);
-	was_empty = list_empty(&registry);
-	list_add(&defer_queue.list, &registry);
+	was_empty = cds_list_empty(&registry);
+	cds_list_add(&defer_queue.list, &registry);
 	mutex_unlock(&rcu_defer_mutex);
 
 	if (was_empty)
@@ -364,11 +364,11 @@ void rcu_defer_unregister_thread(void)
 
 	mutex_lock(&defer_thread_mutex);
 	mutex_lock(&rcu_defer_mutex);
-	list_del(&defer_queue.list);
+	cds_list_del(&defer_queue.list);
 	_rcu_defer_barrier_thread();
 	free(defer_queue.q);
 	defer_queue.q = NULL;
-	is_empty = list_empty(&registry);
+	is_empty = cds_list_empty(&registry);
 	mutex_unlock(&rcu_defer_mutex);
 
 	if (is_empty)
@@ -378,5 +378,5 @@ void rcu_defer_unregister_thread(void)
 
 void rcu_defer_exit(void)
 {
-	assert(list_empty(&registry));
+	assert(cds_list_empty(&registry));
 }
diff --git a/urcu-qsbr-static.h b/urcu-qsbr-static.h
index ab4dcb5..da4a782 100644
--- a/urcu-qsbr-static.h
+++ b/urcu-qsbr-static.h
@@ -135,7 +135,7 @@ struct rcu_reader {
 	/* Data used by both reader and synchronize_rcu() */
 	unsigned long ctr;
 	/* Data used for registry */
-	struct list_head node __attribute__((aligned(CAA_CACHE_LINE_SIZE)));
+	struct cds_list_head node __attribute__((aligned(CAA_CACHE_LINE_SIZE)));
 	pthread_t tid;
 };
 
diff --git a/urcu-qsbr.c b/urcu-qsbr.c
index 51d34c7..b7c42fd 100644
--- a/urcu-qsbr.c
+++ b/urcu-qsbr.c
@@ -59,7 +59,7 @@ unsigned int yield_active;
 unsigned int __thread rand_yield;
 #endif
 
-static LIST_HEAD(registry);
+static CDS_LIST_HEAD(registry);
 
 static void mutex_lock(pthread_mutex_t *mutex)
 {
@@ -108,7 +108,7 @@ static void wait_gp(void)
 
 static void update_counter_and_wait(void)
 {
-	LIST_HEAD(qsreaders);
+	CDS_LIST_HEAD(qsreaders);
 	int wait_loops = 0;
 	struct rcu_reader *index, *tmp;
 
@@ -146,12 +146,12 @@ static void update_counter_and_wait(void)
 			cmm_smp_mb();
 		}
 
-		list_for_each_entry_safe(index, tmp, &registry, node) {
+		cds_list_for_each_entry_safe(index, tmp, &registry, node) {
 			if (!rcu_gp_ongoing(&index->ctr))
-				list_move(&index->node, &qsreaders);
+				cds_list_move(&index->node, &qsreaders);
 		}
 
-		if (list_empty(&registry)) {
+		if (cds_list_empty(&registry)) {
 			if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS) {
 				/* Read reader_gp before write futex */
 				cmm_smp_mb();
@@ -171,7 +171,7 @@ static void update_counter_and_wait(void)
 		}
 	}
 	/* put back the reader list in the registry */
-	list_splice(&qsreaders, &registry);
+	cds_list_splice(&qsreaders, &registry);
 }
 
 /*
@@ -202,7 +202,7 @@ void synchronize_rcu(void)
 
 	mutex_lock(&rcu_gp_lock);
 
-	if (list_empty(&registry))
+	if (cds_list_empty(&registry))
 		goto out;
 
 	/*
@@ -258,7 +258,7 @@ void synchronize_rcu(void)
 		CAA_STORE_SHARED(rcu_reader.ctr, 0);
 
 	mutex_lock(&rcu_gp_lock);
-	if (list_empty(&registry))
+	if (cds_list_empty(&registry))
 		goto out;
 	update_counter_and_wait();
 out:
@@ -305,7 +305,7 @@ void rcu_register_thread(void)
 	assert(rcu_reader.ctr == 0);
 
 	mutex_lock(&rcu_gp_lock);
-	list_add(&rcu_reader.node, &registry);
+	cds_list_add(&rcu_reader.node, &registry);
 	mutex_unlock(&rcu_gp_lock);
 	_rcu_thread_online();
 }
@@ -318,11 +318,11 @@ void rcu_unregister_thread(void)
 	 */
 	_rcu_thread_offline();
 	mutex_lock(&rcu_gp_lock);
-	list_del(&rcu_reader.node);
+	cds_list_del(&rcu_reader.node);
 	mutex_unlock(&rcu_gp_lock);
 }
 
 void rcu_exit(void)
 {
-	assert(list_empty(&registry));
+	assert(cds_list_empty(&registry));
 }
diff --git a/urcu-static.h b/urcu-static.h
index 46fe64a..58dfabb 100644
--- a/urcu-static.h
+++ b/urcu-static.h
@@ -222,7 +222,7 @@ struct rcu_reader {
 	unsigned long ctr;
 	char need_mb;
 	/* Data used for registry */
-	struct list_head node __attribute__((aligned(CAA_CACHE_LINE_SIZE)));
+	struct cds_list_head node __attribute__((aligned(CAA_CACHE_LINE_SIZE)));
 	pthread_t tid;
 };
 
diff --git a/urcu.c b/urcu.c
index b4a5a7d..5a9c2f0 100644
--- a/urcu.c
+++ b/urcu.c
@@ -80,7 +80,7 @@ unsigned int yield_active;
 unsigned int __thread rand_yield;
 #endif
 
-static LIST_HEAD(registry);
+static CDS_LIST_HEAD(registry);
 
 static void mutex_lock(pthread_mutex_t *mutex)
 {
@@ -146,7 +146,7 @@ static void force_mb_all_readers(void)
 	 * Ask for each threads to execute a cmm_smp_mb() so we can consider the
 	 * compiler barriers around rcu read lock as real memory barriers.
 	 */
-	if (list_empty(&registry))
+	if (cds_list_empty(&registry))
 		return;
 	/*
 	 * pthread_kill has a cmm_smp_mb(). But beware, we assume it performs
@@ -154,7 +154,7 @@ static void force_mb_all_readers(void)
 	 * safe and don't assume anything : we use cmm_smp_mc() to make sure the
 	 * cache flush is enforced.
 	 */
-	list_for_each_entry(index, &registry, node) {
+	cds_list_for_each_entry(index, &registry, node) {
 		CAA_STORE_SHARED(index->need_mb, 1);
 		pthread_kill(index->tid, SIGRCU);
 	}
@@ -171,7 +171,7 @@ static void force_mb_all_readers(void)
 	 * relevant bug report.  For Linux kernels, we recommend getting
 	 * the Linux Test Project (LTP).
 	 */
-	list_for_each_entry(index, &registry, node) {
+	cds_list_for_each_entry(index, &registry, node) {
 		while (CAA_LOAD_SHARED(index->need_mb)) {
 			pthread_kill(index->tid, SIGRCU);
 			poll(NULL, 0, 1);
@@ -200,7 +200,7 @@ static void wait_gp(void)
 
 void update_counter_and_wait(void)
 {
-	LIST_HEAD(qsreaders);
+	CDS_LIST_HEAD(qsreaders);
 	int wait_loops = 0;
 	struct rcu_reader *index, *tmp;
 
@@ -234,13 +234,13 @@ void update_counter_and_wait(void)
 			smp_mb_master(RCU_MB_GROUP);
 		}
 
-		list_for_each_entry_safe(index, tmp, &registry, node) {
+		cds_list_for_each_entry_safe(index, tmp, &registry, node) {
 			if (!rcu_gp_ongoing(&index->ctr))
-				list_move(&index->node, &qsreaders);
+				cds_list_move(&index->node, &qsreaders);
 		}
 
 #ifndef HAS_INCOHERENT_CACHES
-		if (list_empty(&registry)) {
+		if (cds_list_empty(&registry)) {
 			if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS) {
 				/* Read reader_gp before write futex */
 				smp_mb_master(RCU_MB_GROUP);
@@ -258,7 +258,7 @@ void update_counter_and_wait(void)
 		 * BUSY-LOOP. Force the reader thread to commit its
 		 * rcu_reader.ctr update to memory if we wait for too long.
 		 */
-		if (list_empty(&registry)) {
+		if (cds_list_empty(&registry)) {
 			if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS) {
 				/* Read reader_gp before write futex */
 				smp_mb_master(RCU_MB_GROUP);
@@ -281,14 +281,14 @@ void update_counter_and_wait(void)
 #endif /* #else #ifndef HAS_INCOHERENT_CACHES */
 	}
 	/* put back the reader list in the registry */
-	list_splice(&qsreaders, &registry);
+	cds_list_splice(&qsreaders, &registry);
 }
 
 void synchronize_rcu(void)
 {
 	mutex_lock(&rcu_gp_lock);
 
-	if (list_empty(&registry))
+	if (cds_list_empty(&registry))
 		goto out;
 
 	/* All threads should read qparity before accessing data structure
@@ -353,14 +353,14 @@ void rcu_register_thread(void)
 
 	mutex_lock(&rcu_gp_lock);
 	rcu_init();	/* In case gcc does not support constructor attribute */
-	list_add(&rcu_reader.node, &registry);
+	cds_list_add(&rcu_reader.node, &registry);
 	mutex_unlock(&rcu_gp_lock);
 }
 
 void rcu_unregister_thread(void)
 {
 	mutex_lock(&rcu_gp_lock);
-	list_del(&rcu_reader.node);
+	cds_list_del(&rcu_reader.node);
 	mutex_unlock(&rcu_gp_lock);
 }
 
@@ -426,6 +426,6 @@ void rcu_exit(void)
 		exit(-1);
 	}
 	assert(act.sa_sigaction == sigrcu_handler);
-	assert(list_empty(&registry));
+	assert(cds_list_empty(&registry));
 }
 #endif /* #ifdef RCU_SIGNAL */
diff --git a/urcu/hlist.h b/urcu/hlist.h
index 9f7776f..e3b94ce 100644
--- a/urcu/hlist.h
+++ b/urcu/hlist.h
@@ -16,41 +16,41 @@
  * published by the Free  Software Foundation.
  */
 
-struct hlist_head
+struct cds_hlist_head
 {
-	struct hlist_node *next;
+	struct cds_hlist_node *next;
 };
 
-struct hlist_node
+struct cds_hlist_node
 {
-	struct hlist_node *next;
-	struct hlist_node *prev;
+	struct cds_hlist_node *next;
+	struct cds_hlist_node *prev;
 };
 
 /* Initialize a new list head.  */
-static inline void  INIT_HLIST_HEAD(struct hlist_head *ptr)
+static inline void  CDS_INIT_HLIST_HEAD(struct cds_hlist_head *ptr)
 {
 	ptr->next = NULL;
 }
 
 /* Get typed element from list at a given position.  */
-#define hlist_entry(ptr, type, member)					\
+#define cds_hlist_entry(ptr, type, member)					\
 	((type *) ((char *) (ptr) - (unsigned long) (&((type *) 0)->member)))
 
 /* Add new element at the head of the list.  */
-static inline void hlist_add_head (struct hlist_node *newp,
-				   struct hlist_head *head)
+static inline void cds_hlist_add_head (struct cds_hlist_node *newp,
+				   struct cds_hlist_head *head)
 {
 	if (head->next)
 		head->next->prev = newp;
 
 	newp->next = head->next;
-	newp->prev = (struct hlist_node *)head;
+	newp->prev = (struct cds_hlist_node *)head;
 	head->next = newp;
 }
 
 /* Remove element from list.  */
-static inline void hlist_del (struct hlist_node *elem)
+static inline void cds_hlist_del (struct cds_hlist_node *elem)
 {
 	if (elem->next)
 		elem->next->prev = elem->prev;
@@ -58,18 +58,18 @@ static inline void hlist_del (struct hlist_node *elem)
 	elem->prev->next = elem->next;
 }
 
-#define hlist_for_each_entry(entry, pos, head, member)			\
+#define cds_hlist_for_each_entry(entry, pos, head, member)			\
 	for (pos = (head)->next,					\
-		     entry = hlist_entry(pos, typeof(*entry), member);	\
+		     entry = cds_hlist_entry(pos, typeof(*entry), member);	\
 	     pos != NULL;						\
 	     pos = pos->next,					\
-		     entry = hlist_entry(pos, typeof(*entry), member))
+		     entry = cds_hlist_entry(pos, typeof(*entry), member))
 
-#define hlist_for_each_entry_safe(entry, pos, p, head, member)		\
+#define cds_hlist_for_each_entry_safe(entry, pos, p, head, member)		\
 	for (pos = (head)->next,					\
-		     entry = hlist_entry(pos, typeof(*entry), member);	\
+		     entry = cds_hlist_entry(pos, typeof(*entry), member);	\
 	     (pos != NULL) && ({ p = pos->next; 1;});			\
 	     pos = p,							\
-		     entry = hlist_entry(pos, typeof(*entry), member))
+		     entry = cds_hlist_entry(pos, typeof(*entry), member))
 
 #endif	/* _KCOMPAT_HLIST_H */
diff --git a/urcu/list.h b/urcu/list.h
index 888e776..b872713 100644
--- a/urcu/list.h
+++ b/urcu/list.h
@@ -26,26 +26,26 @@
 
 
 /* Basic type for the double-link list.  */
-typedef struct list_head
+typedef struct cds_list_head
 {
-  struct list_head *next;
-  struct list_head *prev;
+  struct cds_list_head *next;
+  struct cds_list_head *prev;
 } list_t;
 
 
 /* Define a variable with the head and tail of the list.  */
-#define LIST_HEAD(name) \
+#define CDS_LIST_HEAD(name) \
   list_t name = { &(name), &(name) }
 
 /* Initialize a new list head.  */
-#define INIT_LIST_HEAD(ptr) \
+#define CDS_INIT_LIST_HEAD(ptr) \
   (ptr)->next = (ptr)->prev = (ptr)
 
-#define LIST_HEAD_INIT(name) { .prev = &(name), .next = &(name) }
+#define CDS_LIST_HEAD_INIT(name) { .prev = &(name), .next = &(name) }
 
 /* Add new element at the head of the list.  */
 static inline void
-list_add (list_t *newp, list_t *head)
+cds_list_add (list_t *newp, list_t *head)
 {
   head->next->prev = newp;
   newp->next = head->next;
@@ -56,7 +56,7 @@ list_add (list_t *newp, list_t *head)
 
 /* Add new element at the tail of the list.  */
 static inline void
-list_add_tail (list_t *newp, list_t *head)
+cds_list_add_tail (list_t *newp, list_t *head)
 {
   head->prev->next = newp;
   newp->next = head;
@@ -67,7 +67,7 @@ list_add_tail (list_t *newp, list_t *head)
 
 /* Remove element from list.  */
 static inline void
-__list_del (list_t *prev, list_t *next)
+__cds_list_del (list_t *prev, list_t *next)
 {
   next->prev = prev;
   prev->next = next;
@@ -75,23 +75,23 @@ __list_del (list_t *prev, list_t *next)
 
 /* Remove element from list.  */
 static inline void
-list_del (list_t *elem)
+cds_list_del (list_t *elem)
 {
-  __list_del (elem->prev, elem->next);
+  __cds_list_del (elem->prev, elem->next);
 }
 
 /* delete from list, add to another list as head */
 static inline void
-list_move (list_t *elem, list_t *head)
+cds_list_move (list_t *elem, list_t *head)
 {
-  __list_del (elem->prev, elem->next);
-  list_add (elem, head);
+  __cds_list_del (elem->prev, elem->next);
+  cds_list_add (elem, head);
 }
 
 /* replace an old entry.
  */
 static inline void
-list_replace(list_t *old, list_t *_new)
+cds_list_replace(list_t *old, list_t *_new)
 {
 	_new->next = old->next;
 	_new->prev = old->prev;
@@ -101,7 +101,7 @@ list_replace(list_t *old, list_t *_new)
 
 /* Join two lists.  */
 static inline void
-list_splice (list_t *add, list_t *head)
+cds_list_splice (list_t *add, list_t *head)
 {
   /* Do nothing if the list which gets added is empty.  */
   if (add != add->next)
@@ -115,56 +115,56 @@ list_splice (list_t *add, list_t *head)
 
 
 /* Get typed element from list at a given position.  */
-#define list_entry(ptr, type, member) \
+#define cds_list_entry(ptr, type, member) \
   ((type *) ((char *) (ptr) - (unsigned long) (&((type *) 0)->member)))
 
 
 
 /* Iterate forward over the elements of the list.  */
-#define list_for_each(pos, head) \
+#define cds_list_for_each(pos, head) \
   for (pos = (head)->next; pos != (head); pos = pos->next)
 
 
 /* Iterate forward over the elements of the list.  */
-#define list_for_each_prev(pos, head) \
+#define cds_list_for_each_prev(pos, head) \
   for (pos = (head)->prev; pos != (head); pos = pos->prev)
 
 
 /* Iterate backwards over the elements list.  The list elements can be
    removed from the list while doing this.  */
-#define list_for_each_prev_safe(pos, p, head) \
+#define cds_list_for_each_prev_safe(pos, p, head) \
   for (pos = (head)->prev, p = pos->prev; \
        pos != (head); \
        pos = p, p = pos->prev)
 
-#define list_for_each_entry(pos, head, member)				\
-	for (pos = list_entry((head)->next, typeof(*pos), member);	\
+#define cds_list_for_each_entry(pos, head, member)				\
+	for (pos = cds_list_entry((head)->next, typeof(*pos), member);	\
 	     &pos->member != (head);					\
-	     pos = list_entry(pos->member.next, typeof(*pos), member))
+	     pos = cds_list_entry(pos->member.next, typeof(*pos), member))
 
-#define list_for_each_entry_reverse(pos, head, member)			\
-	for (pos = list_entry((head)->prev, typeof(*pos), member);	\
+#define cds_list_for_each_entry_reverse(pos, head, member)			\
+	for (pos = cds_list_entry((head)->prev, typeof(*pos), member);	\
 	     &pos->member != (head);					\
-	     pos = list_entry(pos->member.prev, typeof(*pos), member))
+	     pos = cds_list_entry(pos->member.prev, typeof(*pos), member))
 
-#define list_for_each_entry_safe(pos, p, head, member)			\
-	for (pos = list_entry((head)->next, typeof(*pos), member),	\
-		     p = list_entry(pos->member.next,typeof(*pos), member); \
+#define cds_list_for_each_entry_safe(pos, p, head, member)			\
+	for (pos = cds_list_entry((head)->next, typeof(*pos), member),	\
+		     p = cds_list_entry(pos->member.next,typeof(*pos), member); \
 	     &pos->member != (head);					\
-	     pos = p, p = list_entry(pos->member.next, typeof(*pos), member))
+	     pos = p, p = cds_list_entry(pos->member.next, typeof(*pos), member))
 
-static inline int list_empty(list_t *head)
+static inline int cds_list_empty(list_t *head)
 {
 	return head == head->next;
 }
 
-static inline void list_replace_init(list_t *old,
+static inline void cds_list_replace_init(list_t *old,
 				     list_t *_new)
 {
 	list_t *head = old->next;
-	list_del(old);
-	list_add_tail(_new, head);
-	INIT_LIST_HEAD(old);
+	cds_list_del(old);
+	cds_list_add_tail(_new, head);
+	CDS_INIT_LIST_HEAD(old);
 }
 
 #endif	/* list.h */
diff --git a/urcu/rcuhlist.h b/urcu/rcuhlist.h
index cce80aa..ef024ab 100644
--- a/urcu/rcuhlist.h
+++ b/urcu/rcuhlist.h
@@ -30,11 +30,11 @@
 
 /* Add new element at the head of the list.
  */
-static inline void hlist_add_head_rcu(struct hlist_node *newp,
-				      struct hlist_head *head)
+static inline void cds_hlist_add_head_rcu(struct cds_hlist_node *newp,
+				      struct cds_hlist_head *head)
 {
 	newp->next = head->next;
-	newp->prev = (struct hlist_node *)head;
+	newp->prev = (struct cds_hlist_node *)head;
 	cmm_smp_wmb();
 	if (head->next)
 		head->next->prev = newp;
@@ -42,7 +42,7 @@ static inline void hlist_add_head_rcu(struct hlist_node *newp,
 }
 
 /* Remove element from list. */
-static inline void hlist_del_rcu(struct hlist_node *elem)
+static inline void cds_hlist_del_rcu(struct cds_hlist_node *elem)
 {
 	if (elem->next)
 		elem->next->prev = elem->prev;
@@ -54,11 +54,11 @@ static inline void hlist_del_rcu(struct hlist_node *elem)
  * This must be done while rcu_read_lock() is held.
  */
 
-#define hlist_for_each_entry_rcu(entry, pos, head, member)		\
+#define cds_hlist_for_each_entry_rcu(entry, pos, head, member)		\
 	for (pos = rcu_dereference((head)->next),			\
-		     entry = hlist_entry(pos, typeof(*entry), member);	\
+		     entry = cds_hlist_entry(pos, typeof(*entry), member);	\
 	     pos != NULL;						\
 	     pos = rcu_dereference(pos->next),				\
-		     entry = hlist_entry(pos, typeof(*entry), member))
+		     entry = cds_hlist_entry(pos, typeof(*entry), member))
 
 #endif	/* _URCU_RCUHLIST_H */
diff --git a/urcu/rculfqueue-static.h b/urcu/rculfqueue-static.h
index ffc5bdb..95294f9 100644
--- a/urcu/rculfqueue-static.h
+++ b/urcu/rculfqueue-static.h
@@ -47,21 +47,21 @@ extern "C" {
 
 #define URCU_LFQ_PERMANENT_REF		128
 
-void _rcu_lfq_node_init(struct rcu_lfq_node *node)
+void _cds_lfq_node_init_rcu(struct cds_lfq_node_rcu *node)
 {
 	node->next = NULL;
 	urcu_ref_init(&node->ref);
 }
 
-void _rcu_lfq_init(struct rcu_lfq_queue *q)
+void _cds_lfq_init_rcu(struct cds_lfq_queue_rcu *q)
 {
-	_rcu_lfq_node_init(&q->init);
+	_cds_lfq_node_init_rcu(&q->init);
 	/* Make sure the initial node is never freed. */
 	urcu_ref_set(&q->init.ref, URCU_LFQ_PERMANENT_REF);
 	q->head = q->tail = &q->init;
 }
 
-void _rcu_lfq_enqueue(struct rcu_lfq_queue *q, struct rcu_lfq_node *node)
+void _cds_lfq_enqueue_rcu(struct cds_lfq_queue_rcu *q, struct cds_lfq_node_rcu *node)
 {
 	urcu_ref_get(&node->ref);
 
@@ -71,7 +71,7 @@ void _rcu_lfq_enqueue(struct rcu_lfq_queue *q, struct rcu_lfq_node *node)
 	 */
 
 	for (;;) {
-		struct rcu_lfq_node *tail, *next;
+		struct cds_lfq_node_rcu *tail, *next;
 
 		rcu_read_lock();
 		tail = rcu_dereference(q->tail);
@@ -105,17 +105,17 @@ void _rcu_lfq_enqueue(struct rcu_lfq_queue *q, struct rcu_lfq_node *node)
  * The entry returned by dequeue must be taken care of by doing a urcu_ref_put,
  * which calls the release primitive when the reference count drops to zero. A
  * grace period must be waited after execution of the release callback before
- * performing the actual memory reclamation or modifying the rcu_lfq_node
+ * performing the actual memory reclamation or modifying the cds_lfq_node_rcu
  * structure.
  * In other words, the entry lfq node returned by dequeue must not be
  * modified/re-used/freed until the reference count reaches zero and a grace
  * period has elapsed (after the refcount reached 0).
  */
-struct rcu_lfq_node *
-_rcu_lfq_dequeue(struct rcu_lfq_queue *q, void (*release)(struct urcu_ref *))
+struct cds_lfq_node_rcu *
+_cds_lfq_dequeue_rcu(struct cds_lfq_queue_rcu *q, void (*release)(struct urcu_ref *))
 {
 	for (;;) {
-		struct rcu_lfq_node *head, *next;
+		struct cds_lfq_node_rcu *head, *next;
 
 		rcu_read_lock();
 		head = rcu_dereference(q->head);
diff --git a/urcu/rculfqueue.h b/urcu/rculfqueue.h
index f229cc7..7b3f81a 100644
--- a/urcu/rculfqueue.h
+++ b/urcu/rculfqueue.h
@@ -40,43 +40,43 @@ extern "C" {
  * which point their reference count will be decremented.
  */
 
-struct rcu_lfq_node {
-	struct rcu_lfq_node *next;
+struct cds_lfq_node_rcu {
+	struct cds_lfq_node_rcu *next;
 	struct urcu_ref ref;
 };
 
-struct rcu_lfq_queue {
-	struct rcu_lfq_node *head, *tail;
-	struct rcu_lfq_node init;	/* Dummy initialization node */
+struct cds_lfq_queue_rcu {
+	struct cds_lfq_node_rcu *head, *tail;
+	struct cds_lfq_node_rcu init;	/* Dummy initialization node */
 };
 
 #ifdef _LGPL_SOURCE
 
 #include <urcu/rculfqueue-static.h>
 
-#define rcu_lfq_node_init	_rcu_lfq_node_init
-#define rcu_lfq_init		_rcu_lfq_init
-#define rcu_lfq_enqueue		_rcu_lfq_enqueue
-#define rcu_lfq_dequeue		_rcu_lfq_dequeue
+#define cds_lfq_node_init_rcu	_cds_lfq_node_init_rcu
+#define cds_lfq_init_rcu		_cds_lfq_init_rcu
+#define cds_lfq_enqueue_rcu		_cds_lfq_enqueue_rcu
+#define cds_lfq_dequeue_rcu		_cds_lfq_dequeue_rcu
 
 #else /* !_LGPL_SOURCE */
 
-extern void rcu_lfq_node_init(struct rcu_lfq_node *node);
-extern void rcu_lfq_init(struct rcu_lfq_queue *q);
-extern void rcu_lfq_enqueue(struct rcu_lfq_queue *q, struct rcu_lfq_node *node);
+extern void cds_lfq_node_init_rcu(struct cds_lfq_node_rcu *node);
+extern void cds_lfq_init_rcu(struct cds_lfq_queue_rcu *q);
+extern void cds_lfq_enqueue_rcu(struct cds_lfq_queue_rcu *q, struct cds_lfq_node_rcu *node);
 
 /*
  * The entry returned by dequeue must be taken care of by doing a urcu_ref_put,
  * which calls the release primitive when the reference count drops to zero. A
  * grace period must be waited after execution of the release callback before
- * performing the actual memory reclamation or modifying the rcu_lfq_node
+ * performing the actual memory reclamation or modifying the cds_lfq_node_rcu
  * structure.
  * In other words, the entry lfq node returned by dequeue must not be
  * modified/re-used/freed until the reference count reaches zero and a grace
  * period has elapsed (after the refcount reached 0).
  */
-extern struct rcu_lfq_node *
-rcu_lfq_dequeue(struct rcu_lfq_queue *q, void (*release)(struct urcu_ref *));
+extern struct cds_lfq_node_rcu *
+cds_lfq_dequeue_rcu(struct cds_lfq_queue_rcu *q, void (*release)(struct urcu_ref *));
 
 #endif /* !_LGPL_SOURCE */
 
diff --git a/urcu/rculfstack-static.h b/urcu/rculfstack-static.h
index 3ce24c5..f541d40 100644
--- a/urcu/rculfstack-static.h
+++ b/urcu/rculfstack-static.h
@@ -33,21 +33,21 @@
 extern "C" {
 #endif
 
-void _rcu_lfs_node_init(struct rcu_lfs_node *node)
+void _cds_lfs_node_init_rcu(struct cds_lfs_node_rcu *node)
 {
 }
 
-void _rcu_lfs_init(struct rcu_lfs_stack *s)
+void _cds_lfs_init_rcu(struct cds_lfs_stack_rcu *s)
 {
 	s->head = NULL;
 }
 
-void _rcu_lfs_push(struct rcu_lfs_stack *s, struct rcu_lfs_node *node)
+void _cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s, struct cds_lfs_node_rcu *node)
 {
-	struct rcu_lfs_node *head = NULL;
+	struct cds_lfs_node_rcu *head = NULL;
 
 	for (;;) {
-		struct rcu_lfs_node *old_head = head;
+		struct cds_lfs_node_rcu *old_head = head;
 
 		node->next = head;
 		/*
@@ -62,19 +62,19 @@ void _rcu_lfs_push(struct rcu_lfs_stack *s, struct rcu_lfs_node *node)
 
 /*
  * The caller must wait for a grace period to pass before freeing the returned
- * node or modifying the rcu_lfs_node structure.
+ * node or modifying the cds_lfs_node_rcu structure.
  * Returns NULL if stack is empty.
  */
-struct rcu_lfs_node *
-_rcu_lfs_pop(struct rcu_lfs_stack *s)
+struct cds_lfs_node_rcu *
+_cds_lfs_pop_rcu(struct cds_lfs_stack_rcu *s)
 {
 	for (;;) {
-		struct rcu_lfs_node *head;
+		struct cds_lfs_node_rcu *head;
 
 		rcu_read_lock();
 		head = rcu_dereference(s->head);
 		if (head) {
-			struct rcu_lfs_node *next = rcu_dereference(head->next);
+			struct cds_lfs_node_rcu *next = rcu_dereference(head->next);
 
 			if (uatomic_cmpxchg(&s->head, head, next) == head) {
 				rcu_read_unlock();
diff --git a/urcu/rculfstack.h b/urcu/rculfstack.h
index a33fcb1..20ac26c 100644
--- a/urcu/rculfstack.h
+++ b/urcu/rculfstack.h
@@ -27,35 +27,35 @@
 extern "C" {
 #endif
 
-struct rcu_lfs_node {
-	struct rcu_lfs_node *next;
+struct cds_lfs_node_rcu {
+	struct cds_lfs_node_rcu *next;
 };
 
-struct rcu_lfs_stack {
-	struct rcu_lfs_node *head;
+struct cds_lfs_stack_rcu {
+	struct cds_lfs_node_rcu *head;
 };
 
 #ifdef _LGPL_SOURCE
 
 #include <urcu/rculfstack-static.h>
 
-#define rcu_lfs_node_init	_rcu_lfs_node_init
-#define rcu_lfs_init		_rcu_lfs_init
-#define rcu_lfs_push		_rcu_lfs_push
-#define rcu_lfs_pop		_rcu_lfs_pop
+#define cds_lfs_node_init_rcu	_cds_lfs_node_init_rcu
+#define cds_lfs_init_rcu		_cds_lfs_init_rcu
+#define cds_lfs_push_rcu		_cds_lfs_push_rcu
+#define cds_lfs_pop_rcu		_cds_lfs_pop_rcu
 
 #else /* !_LGPL_SOURCE */
 
-extern void rcu_lfs_node_init(struct rcu_lfs_node *node);
-extern void rcu_lfs_init(struct rcu_lfs_stack *s);
-extern void rcu_lfs_push(struct rcu_lfs_stack *s, struct rcu_lfs_node *node);
+extern void cds_lfs_node_init_rcu(struct cds_lfs_node_rcu *node);
+extern void cds_lfs_init_rcu(struct cds_lfs_stack_rcu *s);
+extern void cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s, struct cds_lfs_node_rcu *node);
 
 /*
  * The caller must wait for a grace period to pass before freeing the returned
- * node or modifying the rcu_lfs_node structure.
+ * node or modifying the cds_lfs_node_rcu structure.
  * Returns NULL if stack is empty.
  */
-extern struct rcu_lfs_node *rcu_lfs_pop(struct rcu_lfs_stack *s);
+extern struct cds_lfs_node_rcu *cds_lfs_pop_rcu(struct cds_lfs_stack_rcu *s);
 
 #endif /* !_LGPL_SOURCE */
 
diff --git a/urcu/rculist.h b/urcu/rculist.h
index 3a4e335..d5bffbc 100644
--- a/urcu/rculist.h
+++ b/urcu/rculist.h
@@ -30,7 +30,7 @@
 
 /* Add new element at the head of the list.
  */
-static inline void list_add_rcu(list_t *newp, list_t *head)
+static inline void cds_list_add_rcu(list_t *newp, list_t *head)
 {
 	newp->next = head->next;
 	newp->prev = head;
@@ -41,7 +41,7 @@ static inline void list_add_rcu(list_t *newp, list_t *head)
 
 /* replace an old entry atomically.
  */
-static inline void list_replace_rcu(list_t *old, list_t *_new)
+static inline void cds_list_replace_rcu(list_t *old, list_t *_new)
 {
 	_new->next = old->next;
 	_new->prev = old->prev;
@@ -50,7 +50,7 @@ static inline void list_replace_rcu(list_t *old, list_t *_new)
 }
 
 /* Remove element from list. */
-static inline void list_del_rcu(list_t *elem)
+static inline void cds_list_del_rcu(list_t *elem)
 {
 	elem->next->prev = elem->prev;
 	elem->prev->next = elem->next;
@@ -62,16 +62,16 @@ static inline void list_del_rcu(list_t *elem)
  */
 
 /* Iterate forward over the elements of the list.  */
-#define list_for_each_rcu(pos, head) \
+#define cds_list_for_each_rcu(pos, head) \
   for (pos = rcu_dereference((head)->next); pos != (head); \
        pos = rcu_dereference(pos->next))
 
 
 /* Iterate through elements of the list.
  */
-#define list_for_each_entry_rcu(pos, head, member)				\
-	for (pos = list_entry(rcu_dereference((head)->next), typeof(*pos), member);	\
+#define cds_list_for_each_entry_rcu(pos, head, member)				\
+	for (pos = cds_list_entry(rcu_dereference((head)->next), typeof(*pos), member);	\
 	     &pos->member != (head);					\
-	     pos = list_entry(rcu_dereference(pos->member.next), typeof(*pos), member))
+	     pos = cds_list_entry(rcu_dereference(pos->member.next), typeof(*pos), member))
 
 #endif	/* _URCU_RCULIST_H */
diff --git a/urcu/wfqueue-static.h b/urcu/wfqueue-static.h
index d0db3fc..4839c47 100644
--- a/urcu/wfqueue-static.h
+++ b/urcu/wfqueue-static.h
@@ -47,16 +47,16 @@ extern "C" {
 #define WFQ_ADAPT_ATTEMPTS		10	/* Retry if being set */
 #define WFQ_WAIT			10	/* Wait 10 ms if being set */
 
-void _wfq_node_init(struct wfq_node *node)
+void _cds_wfq_node_init(struct cds_wfq_node *node)
 {
 	node->next = NULL;
 }
 
-void _wfq_init(struct wfq_queue *q)
+void _cds_wfq_init(struct cds_wfq_queue *q)
 {
 	int ret;
 
-	_wfq_node_init(&q->dummy);
+	_cds_wfq_node_init(&q->dummy);
 	/* Set queue head and tail */
 	q->head = &q->dummy;
 	q->tail = &q->dummy.next;
@@ -64,9 +64,9 @@ void _wfq_init(struct wfq_queue *q)
 	assert(!ret);
 }
 
-void _wfq_enqueue(struct wfq_queue *q, struct wfq_node *node)
+void _cds_wfq_enqueue(struct cds_wfq_queue *q, struct cds_wfq_node *node)
 {
-	struct wfq_node **old_tail;
+	struct cds_wfq_node **old_tail;
 
 	/*
 	 * uatomic_xchg() implicit memory barrier orders earlier stores to data
@@ -90,10 +90,10 @@ void _wfq_enqueue(struct wfq_queue *q, struct wfq_node *node)
  * thread to be scheduled. The queue appears empty until tail->next is set by
  * enqueue.
  */
-struct wfq_node *
-___wfq_dequeue_blocking(struct wfq_queue *q)
+struct cds_wfq_node *
+___cds_wfq_dequeue_blocking(struct cds_wfq_queue *q)
 {
-	struct wfq_node *node, *next;
+	struct cds_wfq_node *node, *next;
 	int attempt = 0;
 
 	/*
@@ -121,22 +121,22 @@ ___wfq_dequeue_blocking(struct wfq_queue *q)
 	 * Requeue dummy node if we just dequeued it.
 	 */
 	if (node == &q->dummy) {
-		_wfq_node_init(node);
-		_wfq_enqueue(q, node);
-		return ___wfq_dequeue_blocking(q);
+		_cds_wfq_node_init(node);
+		_cds_wfq_enqueue(q, node);
+		return ___cds_wfq_dequeue_blocking(q);
 	}
 	return node;
 }
 
-struct wfq_node *
-_wfq_dequeue_blocking(struct wfq_queue *q)
+struct cds_wfq_node *
+_cds_wfq_dequeue_blocking(struct cds_wfq_queue *q)
 {
-	struct wfq_node *retnode;
+	struct cds_wfq_node *retnode;
 	int ret;
 
 	ret = pthread_mutex_lock(&q->lock);
 	assert(!ret);
-	retnode = ___wfq_dequeue_blocking(q);
+	retnode = ___cds_wfq_dequeue_blocking(q);
 	ret = pthread_mutex_unlock(&q->lock);
 	assert(!ret);
 	return retnode;
diff --git a/urcu/wfqueue.h b/urcu/wfqueue.h
index 5dc64f1..f063900 100644
--- a/urcu/wfqueue.h
+++ b/urcu/wfqueue.h
@@ -40,13 +40,13 @@ extern "C" {
  * Paul E. McKenney.
  */
 
-struct wfq_node {
-	struct wfq_node *next;
+struct cds_wfq_node {
+	struct cds_wfq_node *next;
 };
 
-struct wfq_queue {
-	struct wfq_node *head, **tail;
-	struct wfq_node dummy;	/* Dummy node */
+struct cds_wfq_queue {
+	struct cds_wfq_node *head, **tail;
+	struct cds_wfq_node dummy;	/* Dummy node */
 	pthread_mutex_t lock;
 };
 
@@ -54,20 +54,20 @@ struct wfq_queue {
 
 #include <urcu/wfqueue-static.h>
 
-#define wfq_node_init		_wfq_node_init
-#define wfq_init		_wfq_init
-#define wfq_enqueue		_wfq_enqueue
-#define __wfq_dequeue_blocking	___wfq_dequeue_blocking
-#define wfq_dequeue_blocking	_wfq_dequeue_blocking
+#define cds_wfq_node_init		_cds_wfq_node_init
+#define cds_wfq_init		_cds_wfq_init
+#define cds_wfq_enqueue		_cds_wfq_enqueue
+#define __cds_wfq_dequeue_blocking	___cds_wfq_dequeue_blocking
+#define cds_wfq_dequeue_blocking	_cds_wfq_dequeue_blocking
 
 #else /* !_LGPL_SOURCE */
 
-extern void wfq_node_init(struct wfq_node *node);
-extern void wfq_init(struct wfq_queue *q);
-extern void wfq_enqueue(struct wfq_queue *q, struct wfq_node *node);
-/* __wfq_dequeue_blocking: caller ensures mutual exclusion between dequeues */
-extern struct wfq_node *__wfq_dequeue_blocking(struct wfq_queue *q);
-extern struct wfq_node *wfq_dequeue_blocking(struct wfq_queue *q);
+extern void cds_wfq_node_init(struct cds_wfq_node *node);
+extern void cds_wfq_init(struct cds_wfq_queue *q);
+extern void cds_wfq_enqueue(struct cds_wfq_queue *q, struct cds_wfq_node *node);
+/* __cds_wfq_dequeue_blocking: caller ensures mutual exclusion between dequeues */
+extern struct cds_wfq_node *__cds_wfq_dequeue_blocking(struct cds_wfq_queue *q);
+extern struct cds_wfq_node *cds_wfq_dequeue_blocking(struct cds_wfq_queue *q);
 
 #endif /* !_LGPL_SOURCE */
 
diff --git a/urcu/wfstack-static.h b/urcu/wfstack-static.h
index 0acb4f0..cecdde1 100644
--- a/urcu/wfstack-static.h
+++ b/urcu/wfstack-static.h
@@ -35,27 +35,27 @@
 extern "C" {
 #endif
 
-#define WF_STACK_END			((void *)0x1UL)
-#define WFS_ADAPT_ATTEMPTS		10	/* Retry if being set */
-#define WFS_WAIT			10	/* Wait 10 ms if being set */
+#define CDS_WF_STACK_END			((void *)0x1UL)
+#define CDS_WFS_ADAPT_ATTEMPTS		10	/* Retry if being set */
+#define CDS_WFS_WAIT			10	/* Wait 10 ms if being set */
 
-void _wfs_node_init(struct wfs_node *node)
+void _cds_wfs_node_init(struct cds_wfs_node *node)
 {
 	node->next = NULL;
 }
 
-void _wfs_init(struct wfs_stack *s)
+void _cds_wfs_init(struct cds_wfs_stack *s)
 {
 	int ret;
 
-	s->head = WF_STACK_END;
+	s->head = CDS_WF_STACK_END;
 	ret = pthread_mutex_init(&s->lock, NULL);
 	assert(!ret);
 }
 
-void _wfs_push(struct wfs_stack *s, struct wfs_node *node)
+void _cds_wfs_push(struct cds_wfs_stack *s, struct cds_wfs_node *node)
 {
-	struct wfs_node *old_head;
+	struct cds_wfs_node *old_head;
 
 	assert(node->next == NULL);
 	/*
@@ -73,22 +73,22 @@ void _wfs_push(struct wfs_stack *s, struct wfs_node *node)
 /*
  * Returns NULL if stack is empty.
  */
-struct wfs_node *
-___wfs_pop_blocking(struct wfs_stack *s)
+struct cds_wfs_node *
+___cds_wfs_pop_blocking(struct cds_wfs_stack *s)
 {
-	struct wfs_node *head, *next;
+	struct cds_wfs_node *head, *next;
 	int attempt = 0;
 
 retry:
 	head = CAA_LOAD_SHARED(s->head);
-	if (head == WF_STACK_END)
+	if (head == CDS_WF_STACK_END)
 		return NULL;
 	/*
 	 * Adaptative busy-looping waiting for push to complete.
 	 */
 	while ((next = CAA_LOAD_SHARED(head->next)) == NULL) {
-		if (++attempt >= WFS_ADAPT_ATTEMPTS) {
-			poll(NULL, 0, WFS_WAIT);	/* Wait for 10ms */
+		if (++attempt >= CDS_WFS_ADAPT_ATTEMPTS) {
+			poll(NULL, 0, CDS_WFS_WAIT);	/* Wait for 10ms */
 			attempt = 0;
 		} else
 			caa_cpu_relax();
@@ -99,15 +99,15 @@ retry:
 		goto retry;		/* Concurrent modification. Retry. */
 }
 
-struct wfs_node *
-_wfs_pop_blocking(struct wfs_stack *s)
+struct cds_wfs_node *
+_cds_wfs_pop_blocking(struct cds_wfs_stack *s)
 {
-	struct wfs_node *retnode;
+	struct cds_wfs_node *retnode;
 	int ret;
 
 	ret = pthread_mutex_lock(&s->lock);
 	assert(!ret);
-	retnode = ___wfs_pop_blocking(s);
+	retnode = ___cds_wfs_pop_blocking(s);
 	ret = pthread_mutex_unlock(&s->lock);
 	assert(!ret);
 	return retnode;
diff --git a/urcu/wfstack.h b/urcu/wfstack.h
index 6cb4971..c13ba64 100644
--- a/urcu/wfstack.h
+++ b/urcu/wfstack.h
@@ -31,12 +31,12 @@
 extern "C" {
 #endif
 
-struct wfs_node {
-	struct wfs_node *next;
+struct cds_wfs_node {
+	struct cds_wfs_node *next;
 };
 
-struct wfs_stack {
-	struct wfs_node *head;
+struct cds_wfs_stack {
+	struct cds_wfs_node *head;
 	pthread_mutex_t lock;
 };
 
@@ -44,20 +44,20 @@ struct wfs_stack {
 
 #include <urcu/wfstack-static.h>
 
-#define wfs_node_init		_wfs_node_init
-#define wfs_init		_wfs_init
-#define wfs_push		_wfs_push
-#define __wfs_pop_blocking	___wfs_pop_blocking
-#define wfs_pop_blocking	_wfs_pop_blocking
+#define cds_wfs_node_init		_cds_wfs_node_init
+#define cds_wfs_init		_cds_wfs_init
+#define cds_wfs_push		_cds_wfs_push
+#define __cds_wfs_pop_blocking	___cds_wfs_pop_blocking
+#define cds_wfs_pop_blocking	_cds_wfs_pop_blocking
 
 #else /* !_LGPL_SOURCE */
 
-extern void wfs_node_init(struct wfs_node *node);
-extern void wfs_init(struct wfs_stack *s);
-extern void wfs_push(struct wfs_stack *s, struct wfs_node *node);
-/* __wfs_pop_blocking: caller ensures mutual exclusion between pops */
-extern struct wfs_node *__wfs_pop_blocking(struct wfs_stack *s);
-extern struct wfs_node *wfs_pop_blocking(struct wfs_stack *s);
+extern void cds_wfs_node_init(struct cds_wfs_node *node);
+extern void cds_wfs_init(struct cds_wfs_stack *s);
+extern void cds_wfs_push(struct cds_wfs_stack *s, struct cds_wfs_node *node);
+/* __cds_wfs_pop_blocking: caller ensures mutual exclusion between pops */
+extern struct cds_wfs_node *__cds_wfs_pop_blocking(struct cds_wfs_stack *s);
+extern struct cds_wfs_node *cds_wfs_pop_blocking(struct cds_wfs_stack *s);
 
 #endif /* !_LGPL_SOURCE */
 
diff --git a/wfqueue.c b/wfqueue.c
index 182b4a4..dc7bdfc 100644
--- a/wfqueue.c
+++ b/wfqueue.c
@@ -28,27 +28,27 @@
  * library wrappers to be used by non-LGPL compatible source code.
  */
 
-void wfq_node_init(struct wfq_node *node)
+void cds_wfq_node_init(struct cds_wfq_node *node)
 {
-	_wfq_node_init(node);
+	_cds_wfq_node_init(node);
 }
 
-void wfq_init(struct wfq_queue *q)
+void cds_wfq_init(struct cds_wfq_queue *q)
 {
-	_wfq_init(q);
+	_cds_wfq_init(q);
 }
 
-void wfq_enqueue(struct wfq_queue *q, struct wfq_node *node)
+void cds_wfq_enqueue(struct cds_wfq_queue *q, struct cds_wfq_node *node)
 {
-	_wfq_enqueue(q, node);
+	_cds_wfq_enqueue(q, node);
 }
 
-struct wfq_node *__wfq_dequeue_blocking(struct wfq_queue *q)
+struct cds_wfq_node *__cds_wfq_dequeue_blocking(struct cds_wfq_queue *q)
 {
-	return ___wfq_dequeue_blocking(q);
+	return ___cds_wfq_dequeue_blocking(q);
 }
 
-struct wfq_node *wfq_dequeue_blocking(struct wfq_queue *q)
+struct cds_wfq_node *cds_wfq_dequeue_blocking(struct cds_wfq_queue *q)
 {
-	return _wfq_dequeue_blocking(q);
+	return _cds_wfq_dequeue_blocking(q);
 }
diff --git a/wfstack.c b/wfstack.c
index 6221307..db29558 100644
--- a/wfstack.c
+++ b/wfstack.c
@@ -28,27 +28,27 @@
  * library wrappers to be used by non-LGPL compatible source code.
  */
 
-void wfs_node_init(struct wfs_node *node)
+void cds_wfs_node_init(struct cds_wfs_node *node)
 {
-	_wfs_node_init(node);
+	_cds_wfs_node_init(node);
 }
 
-void wfs_init(struct wfs_stack *s)
+void cds_wfs_init(struct cds_wfs_stack *s)
 {
-	_wfs_init(s);
+	_cds_wfs_init(s);
 }
 
-void wfs_push(struct wfs_stack *s, struct wfs_node *node)
+void cds_wfs_push(struct cds_wfs_stack *s, struct cds_wfs_node *node)
 {
-	_wfs_push(s, node);
+	_cds_wfs_push(s, node);
 }
 
-struct wfs_node *__wfs_pop_blocking(struct wfs_stack *s)
+struct cds_wfs_node *__cds_wfs_pop_blocking(struct cds_wfs_stack *s)
 {
-	return ___wfs_pop_blocking(s);
+	return ___cds_wfs_pop_blocking(s);
 }
 
-struct wfs_node *wfs_pop_blocking(struct wfs_stack *s)
+struct cds_wfs_node *cds_wfs_pop_blocking(struct cds_wfs_stack *s)
 {
-	return _wfs_pop_blocking(s);
+	return _cds_wfs_pop_blocking(s);
 }
-- 
1.7.3.2




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ltt-dev] [URCU PATCH 1/3] Rename all memory primitives with prefix cmm_
  2010-11-18 20:31 [ltt-dev] [URCU PATCH 1/3] Rename all memory primitives with prefix cmm_ David Goulet
  2010-11-18 20:31 ` [ltt-dev] [URCU PATCH 2/3] Rename all arch primitives with prefix caa_ David Goulet
  2010-11-18 20:31 ` [ltt-dev] [URCU PATCH 3/3] Rename all data structure with prefix cds_ David Goulet
@ 2010-11-18 20:57 ` Mathieu Desnoyers
  2 siblings, 0 replies; 4+ messages in thread
From: Mathieu Desnoyers @ 2010-11-18 20:57 UTC (permalink / raw)


* David Goulet (david.goulet at polymtl.ca) wrote:
> In order to not pollute the userspace namespace for application
> using liburcu or any lib/apps linked with urcu, this patch if the
> first of three major refactor for naming convention.
> 
> The cmm_ prefix is a short name for Concurrent Memory Model and was
> suggested by Mathieu Desnoyers and Paul E. Mckenney. Every memory
> primitives such as mb, wmb, rmb, and so on are renamed.

David,

You are my hero! :-)

All three patches committed and pushed.

Version 0.5.0 is on its way.

Thanks!

Mathieu

> 
> Signed-off-by: David Goulet <david.goulet at polymtl.ca>
> ---
>  compat_futex.c             |    4 +-
>  tests/api_gcc.h            |    8 ++--
>  tests/api_ppc.h            |    8 ++--
>  tests/api_x86.h            |    8 ++--
>  tests/rcutorture.h         |   18 ++++----
>  tests/test_mutex.c         |    6 +-
>  tests/test_perthreadlock.c |    6 +-
>  tests/test_qsbr.c          |    6 +-
>  tests/test_qsbr_gc.c       |    6 +-
>  tests/test_rwlock.c        |    6 +-
>  tests/test_urcu.c          |    6 +-
>  tests/test_urcu_assign.c   |    6 +-
>  tests/test_urcu_bp.c       |    6 +-
>  tests/test_urcu_defer.c    |    6 +-
>  tests/test_urcu_gc.c       |    6 +-
>  tests/test_urcu_lfq.c      |    6 +-
>  tests/test_urcu_lfs.c      |    6 +-
>  tests/test_urcu_wfq.c      |    6 +-
>  tests/test_urcu_wfs.c      |    6 +-
>  urcu-bp-static.h           |    8 ++--
>  urcu-bp.c                  |   16 ++++----
>  urcu-defer.c               |   14 +++---
>  urcu-pointer-static.h      |    8 ++--
>  urcu-pointer.c             |    6 +-
>  urcu-qsbr-static.h         |   16 ++++----
>  urcu-qsbr.c                |   28 ++++++------
>  urcu-static.h              |   12 +++---
>  urcu.c                     |   36 ++++++++--------
>  urcu/arch_alpha.h          |    6 +-
>  urcu/arch_armv7l.h         |    2 +-
>  urcu/arch_generic.h        |   98 ++++++++++++++++++++++----------------------
>  urcu/arch_ppc.h            |    6 +-
>  urcu/arch_s390.h           |    2 +-
>  urcu/arch_sparc64.h        |    6 +-
>  urcu/arch_x86.h            |   14 +++---
>  urcu/compiler.h            |    2 +-
>  urcu/rcuhlist.h            |    2 +-
>  urcu/rculist.h             |    2 +-
>  urcu/system.h              |    8 ++--
>  39 files changed, 211 insertions(+), 211 deletions(-)
> 
> diff --git a/compat_futex.c b/compat_futex.c
> index 61bc6c3..9dfcfeb 100644
> --- a/compat_futex.c
> +++ b/compat_futex.c
> @@ -55,7 +55,7 @@ int compat_futex_noasync(int *uaddr, int op, int val,
>  	/*
>  	 * memory barriers to serialize with the previous uaddr modification.
>  	 */
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	ret = pthread_mutex_lock(&compat_futex_lock);
>  	assert(!ret);
> @@ -100,7 +100,7 @@ int compat_futex_async(int *uaddr, int op, int val,
>  	/*
>  	 * Ensure previous memory operations on uaddr have completed.
>  	 */
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	switch (op) {
>  	case FUTEX_WAIT:
> diff --git a/tests/api_gcc.h b/tests/api_gcc.h
> index be437cc..b23110d 100644
> --- a/tests/api_gcc.h
> +++ b/tests/api_gcc.h
> @@ -251,10 +251,10 @@ cmpxchg(volatile long *ptr, long oldval, long newval)
>  #define atomic_dec_return(v)  (atomic_sub_return(1,v))
>  
>  /* Atomic operations are already serializing on x86 */
> -#define smp_mb__before_atomic_dec()	barrier()
> -#define smp_mb__after_atomic_dec()	barrier()
> -#define smp_mb__before_atomic_inc()	barrier()
> -#define smp_mb__after_atomic_inc()	barrier()
> +#define smp_mb__before_atomic_dec()	cmm_barrier()
> +#define smp_mb__after_atomic_dec()	cmm_barrier()
> +#define smp_mb__before_atomic_inc()	cmm_barrier()
> +#define smp_mb__after_atomic_inc()	cmm_barrier()
>  
>  #endif //0 /* duplicate with arch_atomic.h */
>  
> diff --git a/tests/api_ppc.h b/tests/api_ppc.h
> index 6548077..9773500 100644
> --- a/tests/api_ppc.h
> +++ b/tests/api_ppc.h
> @@ -616,10 +616,10 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
>  #define atomic_dec_return(v)  (atomic_sub_return(1,v))
>  
>  /* Atomic operations are already serializing on x86 */
> -#define smp_mb__before_atomic_dec()	smp_mb()
> -#define smp_mb__after_atomic_dec()	smp_mb()
> -#define smp_mb__before_atomic_inc()	smp_mb()
> -#define smp_mb__after_atomic_inc()	smp_mb()
> +#define smp_mb__before_atomic_dec()	cmm_smp_mb()
> +#define smp_mb__after_atomic_dec()	cmm_smp_mb()
> +#define smp_mb__before_atomic_inc()	cmm_smp_mb()
> +#define smp_mb__after_atomic_inc()	cmm_smp_mb()
>  
>  #endif //0 /* duplicate with arch_atomic.h */
>  
> diff --git a/tests/api_x86.h b/tests/api_x86.h
> index cdd4667..fe00a35 100644
> --- a/tests/api_x86.h
> +++ b/tests/api_x86.h
> @@ -312,10 +312,10 @@ __asm__ __volatile__(LOCK_PREFIX "orl %0,%1" \
>  : : "r" (mask),"m" (*(addr)) : "memory")
>  
>  /* Atomic operations are already serializing on x86 */
> -#define smp_mb__before_atomic_dec()	barrier()
> -#define smp_mb__after_atomic_dec()	barrier()
> -#define smp_mb__before_atomic_inc()	barrier()
> -#define smp_mb__after_atomic_inc()	barrier()
> +#define smp_mb__before_atomic_dec()	cmm_barrier()
> +#define smp_mb__after_atomic_dec()	cmm_barrier()
> +#define smp_mb__before_atomic_inc()	cmm_barrier()
> +#define smp_mb__after_atomic_inc()	cmm_barrier()
>  
>  #endif //0
>  
> diff --git a/tests/rcutorture.h b/tests/rcutorture.h
> index 181547a..4192bd0 100644
> --- a/tests/rcutorture.h
> +++ b/tests/rcutorture.h
> @@ -170,15 +170,15 @@ void perftestrun(int nthreads, int nreaders, int nupdaters)
>  	int t;
>  	int duration = 1;
>  
> -	smp_mb();
> +	cmm_smp_mb();
>  	while (uatomic_read(&nthreadsrunning) < nthreads)
>  		poll(NULL, 0, 1);
>  	goflag = GOFLAG_RUN;
> -	smp_mb();
> +	cmm_smp_mb();
>  	sleep(duration);
> -	smp_mb();
> +	cmm_smp_mb();
>  	goflag = GOFLAG_STOP;
> -	smp_mb();
> +	cmm_smp_mb();
>  	wait_all_threads();
>  	for_each_thread(t) {
>  		n_reads += per_thread(n_reads_pt, t);
> @@ -309,7 +309,7 @@ void *rcu_update_stress_test(void *arg)
>  			i = 0;
>  		p = &rcu_stress_array[i];
>  		p->mbtest = 0;
> -		smp_mb();
> +		cmm_smp_mb();
>  		p->pipe_count = 0;
>  		p->mbtest = 1;
>  		rcu_assign_pointer(rcu_stress_current, p);
> @@ -355,13 +355,13 @@ void stresstest(int nreaders)
>  	create_thread(rcu_update_stress_test, NULL);
>  	for (i = 0; i < 5; i++)
>  		create_thread(rcu_fake_update_stress_test, NULL);
> -	smp_mb();
> +	cmm_smp_mb();
>  	goflag = GOFLAG_RUN;
> -	smp_mb();
> +	cmm_smp_mb();
>  	sleep(10);
> -	smp_mb();
> +	cmm_smp_mb();
>  	goflag = GOFLAG_STOP;
> -	smp_mb();
> +	cmm_smp_mb();
>  	wait_all_threads();
>  	for_each_thread(t)
>  		n_reads += per_thread(n_reads_pt, t);
> diff --git a/tests/test_mutex.c b/tests/test_mutex.c
> index 7b2d1a5..7dd1e31 100644
> --- a/tests/test_mutex.c
> +++ b/tests/test_mutex.c
> @@ -229,7 +229,7 @@ void *thr_writer(void *data)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		pthread_mutex_lock(&lock);
> @@ -278,7 +278,7 @@ int main(int argc, char **argv)
>  		show_usage(argc, argv);
>  		return -1;
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	err = sscanf(argv[1], "%u", &nr_readers);
>  	if (err != 1) {
> @@ -376,7 +376,7 @@ int main(int argc, char **argv)
>  			exit(1);
>  	}
>  
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	test_go = 1;
>  
> diff --git a/tests/test_perthreadlock.c b/tests/test_perthreadlock.c
> index 7862f62..9de8ced 100644
> --- a/tests/test_perthreadlock.c
> +++ b/tests/test_perthreadlock.c
> @@ -234,7 +234,7 @@ void *thr_writer(void *data)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		for (tidx = 0; tidx < nr_readers; tidx++) {
> @@ -287,7 +287,7 @@ int main(int argc, char **argv)
>  		show_usage(argc, argv);
>  		return -1;
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	err = sscanf(argv[1], "%u", &nr_readers);
>  	if (err != 1) {
> @@ -386,7 +386,7 @@ int main(int argc, char **argv)
>  			exit(1);
>  	}
>  
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	test_go = 1;
>  
> diff --git a/tests/test_qsbr.c b/tests/test_qsbr.c
> index 0101907..4f19c72 100644
> --- a/tests/test_qsbr.c
> +++ b/tests/test_qsbr.c
> @@ -230,7 +230,7 @@ void *thr_reader(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		rcu_read_lock();
> @@ -275,7 +275,7 @@ void *thr_writer(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		new = test_array_alloc();
> @@ -424,7 +424,7 @@ int main(int argc, char **argv)
>  			exit(1);
>  	}
>  
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	test_go = 1;
>  
> diff --git a/tests/test_qsbr_gc.c b/tests/test_qsbr_gc.c
> index 2b4fa7a..875fd36 100644
> --- a/tests/test_qsbr_gc.c
> +++ b/tests/test_qsbr_gc.c
> @@ -203,7 +203,7 @@ void *thr_reader(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		_rcu_read_lock();
> @@ -279,7 +279,7 @@ void *thr_writer(void *data)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  #ifndef TEST_LOCAL_GC
> @@ -444,7 +444,7 @@ int main(int argc, char **argv)
>  			exit(1);
>  	}
>  
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	test_go = 1;
>  
> diff --git a/tests/test_rwlock.c b/tests/test_rwlock.c
> index 1c65fca..445ce95 100644
> --- a/tests/test_rwlock.c
> +++ b/tests/test_rwlock.c
> @@ -225,7 +225,7 @@ void *thr_writer(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		pthread_rwlock_wrlock(&lock);
> @@ -274,7 +274,7 @@ int main(int argc, char **argv)
>  		show_usage(argc, argv);
>  		return -1;
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	err = sscanf(argv[1], "%u", &nr_readers);
>  	if (err != 1) {
> @@ -370,7 +370,7 @@ int main(int argc, char **argv)
>  			exit(1);
>  	}
>  
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	test_go = 1;
>  
> diff --git a/tests/test_urcu.c b/tests/test_urcu.c
> index 5096415..eeea7f5 100644
> --- a/tests/test_urcu.c
> +++ b/tests/test_urcu.c
> @@ -231,7 +231,7 @@ void *thr_reader(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		rcu_read_lock();
> @@ -273,7 +273,7 @@ void *thr_writer(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		new = test_array_alloc();
> @@ -421,7 +421,7 @@ int main(int argc, char **argv)
>  			exit(1);
>  	}
>  
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	test_go = 1;
>  
> diff --git a/tests/test_urcu_assign.c b/tests/test_urcu_assign.c
> index b1298a4..481cdd6 100644
> --- a/tests/test_urcu_assign.c
> +++ b/tests/test_urcu_assign.c
> @@ -231,7 +231,7 @@ void *thr_reader(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		rcu_read_lock();
> @@ -269,7 +269,7 @@ void *thr_writer(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		new = test_array_alloc();
> @@ -420,7 +420,7 @@ int main(int argc, char **argv)
>  			exit(1);
>  	}
>  
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	test_go = 1;
>  
> diff --git a/tests/test_urcu_bp.c b/tests/test_urcu_bp.c
> index 239e843..e831824 100644
> --- a/tests/test_urcu_bp.c
> +++ b/tests/test_urcu_bp.c
> @@ -231,7 +231,7 @@ void *thr_reader(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		rcu_read_lock();
> @@ -269,7 +269,7 @@ void *thr_writer(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		new = test_array_alloc();
> @@ -417,7 +417,7 @@ int main(int argc, char **argv)
>  			exit(1);
>  	}
>  
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	test_go = 1;
>  
> diff --git a/tests/test_urcu_defer.c b/tests/test_urcu_defer.c
> index 6fae313..2cbb041 100644
> --- a/tests/test_urcu_defer.c
> +++ b/tests/test_urcu_defer.c
> @@ -199,7 +199,7 @@ void *thr_reader(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		rcu_read_lock();
> @@ -247,7 +247,7 @@ void *thr_writer(void *data)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		new = malloc(sizeof(*new));
> @@ -400,7 +400,7 @@ int main(int argc, char **argv)
>  			exit(1);
>  	}
>  
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	test_go = 1;
>  
> diff --git a/tests/test_urcu_gc.c b/tests/test_urcu_gc.c
> index 2c944a5..ddafb87 100644
> --- a/tests/test_urcu_gc.c
> +++ b/tests/test_urcu_gc.c
> @@ -207,7 +207,7 @@ void *thr_reader(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		rcu_read_lock();
> @@ -280,7 +280,7 @@ void *thr_writer(void *data)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  #ifndef TEST_LOCAL_GC
> @@ -444,7 +444,7 @@ int main(int argc, char **argv)
>  			exit(1);
>  	}
>  
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	test_go = 1;
>  
> diff --git a/tests/test_urcu_lfq.c b/tests/test_urcu_lfq.c
> index 87c53b6..901bcae 100644
> --- a/tests/test_urcu_lfq.c
> +++ b/tests/test_urcu_lfq.c
> @@ -170,7 +170,7 @@ void *thr_enqueuer(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		struct rcu_lfq_node *node = malloc(sizeof(*node));
> @@ -223,7 +223,7 @@ void *thr_dequeuer(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		struct rcu_lfq_node *node = rcu_lfq_dequeue(&q,
> @@ -380,7 +380,7 @@ int main(int argc, char **argv)
>  			exit(1);
>  	}
>  
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	test_go = 1;
>  
> diff --git a/tests/test_urcu_lfs.c b/tests/test_urcu_lfs.c
> index 8f881e7..8249eba 100644
> --- a/tests/test_urcu_lfs.c
> +++ b/tests/test_urcu_lfs.c
> @@ -170,7 +170,7 @@ void *thr_enqueuer(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		struct rcu_lfs_node *node = malloc(sizeof(*node));
> @@ -215,7 +215,7 @@ void *thr_dequeuer(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		struct rcu_lfs_node *node = rcu_lfs_pop(&s);
> @@ -365,7 +365,7 @@ int main(int argc, char **argv)
>  			exit(1);
>  	}
>  
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	test_go = 1;
>  
> diff --git a/tests/test_urcu_wfq.c b/tests/test_urcu_wfq.c
> index b0629d2..d446e47 100644
> --- a/tests/test_urcu_wfq.c
> +++ b/tests/test_urcu_wfq.c
> @@ -167,7 +167,7 @@ void *thr_enqueuer(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		struct wfq_node *node = malloc(sizeof(*node));
> @@ -207,7 +207,7 @@ void *thr_dequeuer(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		struct wfq_node *node = wfq_dequeue_blocking(&q);
> @@ -354,7 +354,7 @@ int main(int argc, char **argv)
>  			exit(1);
>  	}
>  
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	test_go = 1;
>  
> diff --git a/tests/test_urcu_wfs.c b/tests/test_urcu_wfs.c
> index f50b140..294e955 100644
> --- a/tests/test_urcu_wfs.c
> +++ b/tests/test_urcu_wfs.c
> @@ -167,7 +167,7 @@ void *thr_enqueuer(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		struct wfs_node *node = malloc(sizeof(*node));
> @@ -207,7 +207,7 @@ void *thr_dequeuer(void *_count)
>  	while (!test_go)
>  	{
>  	}
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	for (;;) {
>  		struct wfs_node *node = wfs_pop_blocking(&s);
> @@ -354,7 +354,7 @@ int main(int argc, char **argv)
>  			exit(1);
>  	}
>  
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	test_go = 1;
>  
> diff --git a/urcu-bp-static.h b/urcu-bp-static.h
> index 6d7e3c8..394476b 100644
> --- a/urcu-bp-static.h
> +++ b/urcu-bp-static.h
> @@ -175,7 +175,7 @@ static inline void _rcu_read_lock(void)
>  	if (unlikely(!rcu_reader))
>  		rcu_bp_register();
>  
> -	barrier();	/* Ensure the compiler does not reorder us with mutex */
> +	cmm_barrier();	/* Ensure the compiler does not reorder us with mutex */
>  	tmp = rcu_reader->ctr;
>  	/*
>  	 * rcu_gp_ctr is
> @@ -187,7 +187,7 @@ static inline void _rcu_read_lock(void)
>  		 * Set active readers count for outermost nesting level before
>  		 * accessing the pointer.
>  		 */
> -		smp_mb();
> +		cmm_smp_mb();
>  	} else {
>  		_STORE_SHARED(rcu_reader->ctr, tmp + RCU_GP_COUNT);
>  	}
> @@ -198,9 +198,9 @@ static inline void _rcu_read_unlock(void)
>  	/*
>  	 * Finish using rcu before decrementing the pointer.
>  	 */
> -	smp_mb();
> +	cmm_smp_mb();
>  	_STORE_SHARED(rcu_reader->ctr, rcu_reader->ctr - RCU_GP_COUNT);
> -	barrier();	/* Ensure the compiler does not reorder us with mutex */
> +	cmm_barrier();	/* Ensure the compiler does not reorder us with mutex */
>  }
>  
>  #ifdef __cplusplus 
> diff --git a/urcu-bp.c b/urcu-bp.c
> index 61d42fa..33352c2 100644
> --- a/urcu-bp.c
> +++ b/urcu-bp.c
> @@ -96,9 +96,9 @@ static void mutex_lock(pthread_mutex_t *mutex)
>  			exit(-1);
>  		}
>  		if (rcu_reader.need_mb) {
> -			smp_mb();
> +			cmm_smp_mb();
>  			rcu_reader.need_mb = 0;
> -			smp_mb();
> +			cmm_smp_mb();
>  		}
>  		poll(NULL,0,10);
>  	}
> @@ -133,11 +133,11 @@ void update_counter_and_wait(void)
>  	 */
>  
>  	/*
> -	 * Adding a smp_mb() which is _not_ formally required, but makes the
> +	 * Adding a cmm_smp_mb() which is _not_ formally required, but makes the
>  	 * model easier to understand. It does not have a big performance impact
>  	 * anyway, given this is the write-side.
>  	 */
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	/*
>  	 * Wait for each thread rcu_reader.ctr count to become 0.
> @@ -180,7 +180,7 @@ void synchronize_rcu(void)
>  	/* All threads should read qparity before accessing data structure
>  	 * where new ptr points to. */
>  	/* Write new ptr before changing the qparity */
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	/* Remove old registry elements */
>  	rcu_gc_registry();
> @@ -191,11 +191,11 @@ void synchronize_rcu(void)
>  	update_counter_and_wait();	/* 0 -> 1, wait readers in parity 0 */
>  
>  	/*
> -	 * Adding a smp_mb() which is _not_ formally required, but makes the
> +	 * Adding a cmm_smp_mb() which is _not_ formally required, but makes the
>  	 * model easier to understand. It does not have a big performance impact
>  	 * anyway, given this is the write-side.
>  	 */
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	/*
>  	 * Wait for previous parity to be empty of readers.
> @@ -206,7 +206,7 @@ void synchronize_rcu(void)
>  	 * Finish waiting for reader threads before letting the old ptr being
>  	 * freed.
>  	 */
> -	smp_mb();
> +	cmm_smp_mb();
>  out:
>  	mutex_unlock(&rcu_gp_lock);
>  	ret = pthread_sigmask(SIG_SETMASK, &oldmask, NULL);
> diff --git a/urcu-defer.c b/urcu-defer.c
> index e241302..6dc08a3 100644
> --- a/urcu-defer.c
> +++ b/urcu-defer.c
> @@ -123,13 +123,13 @@ static unsigned long rcu_defer_num_callbacks(void)
>  static void wait_defer(void)
>  {
>  	uatomic_dec(&defer_thread_futex);
> -	smp_mb();	/* Write futex before read queue */
> +	cmm_smp_mb();	/* Write futex before read queue */
>  	if (rcu_defer_num_callbacks()) {
> -		smp_mb();	/* Read queue before write futex */
> +		cmm_smp_mb();	/* Read queue before write futex */
>  		/* Callbacks are queued, don't wait. */
>  		uatomic_set(&defer_thread_futex, 0);
>  	} else {
> -		smp_rmb();	/* Read queue before read futex */
> +		cmm_smp_rmb();	/* Read queue before read futex */
>  		if (uatomic_read(&defer_thread_futex) == -1)
>  			futex_noasync(&defer_thread_futex, FUTEX_WAIT, -1,
>  			      NULL, NULL, 0);
> @@ -152,7 +152,7 @@ static void rcu_defer_barrier_queue(struct defer_queue *queue,
>  	 */
>  
>  	for (i = queue->tail; i != head;) {
> -		smp_rmb();       /* read head before q[]. */
> +		cmm_smp_rmb();       /* read head before q[]. */
>  		p = LOAD_SHARED(queue->q[i++ & DEFER_QUEUE_MASK]);
>  		if (unlikely(DQ_IS_FCT_BIT(p))) {
>  			DQ_CLEAR_FCT_BIT(p);
> @@ -166,7 +166,7 @@ static void rcu_defer_barrier_queue(struct defer_queue *queue,
>  		fct = queue->last_fct_out;
>  		fct(p);
>  	}
> -	smp_mb();	/* push tail after having used q[] */
> +	cmm_smp_mb();	/* push tail after having used q[] */
>  	STORE_SHARED(queue->tail, i);
>  }
>  
> @@ -283,10 +283,10 @@ void _defer_rcu(void (*fct)(void *p), void *p)
>  		}
>  	}
>  	_STORE_SHARED(defer_queue.q[head++ & DEFER_QUEUE_MASK], p);
> -	smp_wmb();	/* Publish new pointer before head */
> +	cmm_smp_wmb();	/* Publish new pointer before head */
>  			/* Write q[] before head. */
>  	STORE_SHARED(defer_queue.head, head);
> -	smp_mb();	/* Write queue head before read futex */
> +	cmm_smp_mb();	/* Write queue head before read futex */
>  	/*
>  	 * Wake-up any waiting defer thread.
>  	 */
> diff --git a/urcu-pointer-static.h b/urcu-pointer-static.h
> index 983d0d5..c8ac7f0 100644
> --- a/urcu-pointer-static.h
> +++ b/urcu-pointer-static.h
> @@ -63,7 +63,7 @@ extern "C" {
>  
>  #define _rcu_dereference(p)     ({					\
>  				typeof(p) _________p1 = LOAD_SHARED(p); \
> -				smp_read_barrier_depends();		\
> +				cmm_smp_read_barrier_depends();		\
>  				(_________p1);				\
>  				})
>  
> @@ -81,7 +81,7 @@ extern "C" {
>  		typeof(*p) _________pnew = (_new);			\
>  		if (!__builtin_constant_p(_new) ||			\
>  		    ((_new) != NULL))					\
> -			wmb();						\
> +			cmm_wmb();						\
>  		uatomic_cmpxchg(p, _________pold, _________pnew);	\
>  	})
>  
> @@ -96,7 +96,7 @@ extern "C" {
>  		typeof(*p) _________pv = (v);		\
>  		if (!__builtin_constant_p(v) ||		\
>  		    ((v) != NULL))			\
> -			wmb();				\
> +			cmm_wmb();				\
>  		uatomic_xchg(p, _________pv);		\
>  	})
>  
> @@ -106,7 +106,7 @@ extern "C" {
>  		typeof(*p) _________pv = (v);		\
>  		if (!__builtin_constant_p(v) || 	\
>  		    ((v) != NULL))			\
> -			wmb();				\
> +			cmm_wmb();				\
>  		uatomic_set(p, _________pv);		\
>  	})
>  
> diff --git a/urcu-pointer.c b/urcu-pointer.c
> index f5c9811..180c834 100644
> --- a/urcu-pointer.c
> +++ b/urcu-pointer.c
> @@ -39,18 +39,18 @@ void *rcu_dereference_sym(void *p)
>  
>  void *rcu_set_pointer_sym(void **p, void *v)
>  {
> -	wmb();
> +	cmm_wmb();
>  	return uatomic_set(p, v);
>  }
>  
>  void *rcu_xchg_pointer_sym(void **p, void *v)
>  {
> -	wmb();
> +	cmm_wmb();
>  	return uatomic_xchg(p, v);
>  }
>  
>  void *rcu_cmpxchg_pointer_sym(void **p, void *old, void *_new)
>  {
> -	wmb();
> +	cmm_wmb();
>  	return uatomic_cmpxchg(p, old, _new);
>  }
> diff --git a/urcu-qsbr-static.h b/urcu-qsbr-static.h
> index 147eb18..108ef6e 100644
> --- a/urcu-qsbr-static.h
> +++ b/urcu-qsbr-static.h
> @@ -174,27 +174,27 @@ static inline void _rcu_read_unlock(void)
>  
>  static inline void _rcu_quiescent_state(void)
>  {
> -	smp_mb();	
> +	cmm_smp_mb();
>  	_STORE_SHARED(rcu_reader.ctr, _LOAD_SHARED(rcu_gp_ctr));
> -	smp_mb();	/* write rcu_reader.ctr before read futex */
> +	cmm_smp_mb();	/* write rcu_reader.ctr before read futex */
>  	wake_up_gp();
> -	smp_mb();
> +	cmm_smp_mb();
>  }
>  
>  static inline void _rcu_thread_offline(void)
>  {
> -	smp_mb();
> +	cmm_smp_mb();
>  	STORE_SHARED(rcu_reader.ctr, 0);
> -	smp_mb();	/* write rcu_reader.ctr before read futex */
> +	cmm_smp_mb();	/* write rcu_reader.ctr before read futex */
>  	wake_up_gp();
> -	barrier();	/* Ensure the compiler does not reorder us with mutex */
> +	cmm_barrier();	/* Ensure the compiler does not reorder us with mutex */
>  }
>  
>  static inline void _rcu_thread_online(void)
>  {
> -	barrier();	/* Ensure the compiler does not reorder us with mutex */
> +	cmm_barrier();	/* Ensure the compiler does not reorder us with mutex */
>  	_STORE_SHARED(rcu_reader.ctr, LOAD_SHARED(rcu_gp_ctr));
> -	smp_mb();
> +	cmm_smp_mb();
>  }
>  
>  #ifdef __cplusplus 
> diff --git a/urcu-qsbr.c b/urcu-qsbr.c
> index 5e8b960..2cf73d5 100644
> --- a/urcu-qsbr.c
> +++ b/urcu-qsbr.c
> @@ -100,7 +100,7 @@ static void mutex_unlock(pthread_mutex_t *mutex)
>  static void wait_gp(void)
>  {
>  	/* Read reader_gp before read futex */
> -	smp_rmb();
> +	cmm_smp_rmb();
>  	if (uatomic_read(&gp_futex) == -1)
>  		futex_noasync(&gp_futex, FUTEX_WAIT, -1,
>  		      NULL, NULL, 0);
> @@ -126,14 +126,14 @@ static void update_counter_and_wait(void)
>  	 * while new readers are always accessing data (no progress). Enforce
>  	 * compiler-order of store to rcu_gp_ctr before load rcu_reader ctr.
>  	 */
> -	barrier();
> +	cmm_barrier();
>  
>  	/*
> -	 * Adding a smp_mb() which is _not_ formally required, but makes the
> +	 * Adding a cmm_smp_mb() which is _not_ formally required, but makes the
>  	 * model easier to understand. It does not have a big performance impact
>  	 * anyway, given this is the write-side.
>  	 */
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	/*
>  	 * Wait for each thread rcu_reader_qs_gp count to become 0.
> @@ -143,7 +143,7 @@ static void update_counter_and_wait(void)
>  		if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS) {
>  			uatomic_dec(&gp_futex);
>  			/* Write futex before read reader_gp */
> -			smp_mb();
> +			cmm_smp_mb();
>  		}
>  
>  		list_for_each_entry_safe(index, tmp, &registry, node) {
> @@ -154,7 +154,7 @@ static void update_counter_and_wait(void)
>  		if (list_empty(&registry)) {
>  			if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS) {
>  				/* Read reader_gp before write futex */
> -				smp_mb();
> +				cmm_smp_mb();
>  				uatomic_set(&gp_futex, 0);
>  			}
>  			break;
> @@ -165,7 +165,7 @@ static void update_counter_and_wait(void)
>  #ifndef HAS_INCOHERENT_CACHES
>  				cpu_relax();
>  #else /* #ifndef HAS_INCOHERENT_CACHES */
> -				smp_mb();
> +				cmm_smp_mb();
>  #endif /* #else #ifndef HAS_INCOHERENT_CACHES */
>  			}
>  		}
> @@ -190,7 +190,7 @@ void synchronize_rcu(void)
>  	 * where new ptr points to.
>  	 */
>  	/* Write new ptr before changing the qparity */
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	/*
>  	 * Mark the writer thread offline to make sure we don't wait for
> @@ -217,14 +217,14 @@ void synchronize_rcu(void)
>  	 * accessing data (no progress).  Enforce compiler-order of load
>  	 * rcu_reader ctr before store to rcu_gp_ctr.
>  	 */
> -	barrier();
> +	cmm_barrier();
>  
>  	/*
> -	 * Adding a smp_mb() which is _not_ formally required, but makes the
> +	 * Adding a cmm_smp_mb() which is _not_ formally required, but makes the
>  	 * model easier to understand. It does not have a big performance impact
>  	 * anyway, given this is the write-side.
>  	 */
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	/*
>  	 * Wait for previous parity to be empty of readers.
> @@ -239,7 +239,7 @@ out:
>  	 */
>  	if (was_online)
>  		_STORE_SHARED(rcu_reader.ctr, LOAD_SHARED(rcu_gp_ctr));
> -	smp_mb();
> +	cmm_smp_mb();
>  }
>  #else /* !(BITS_PER_LONG < 64) */
>  void synchronize_rcu(void)
> @@ -253,7 +253,7 @@ void synchronize_rcu(void)
>  	 * our own quiescent state. This allows using synchronize_rcu() in
>  	 * threads registered as readers.
>  	 */
> -	smp_mb();
> +	cmm_smp_mb();
>  	if (was_online)
>  		STORE_SHARED(rcu_reader.ctr, 0);
>  
> @@ -266,7 +266,7 @@ out:
>  
>  	if (was_online)
>  		_STORE_SHARED(rcu_reader.ctr, LOAD_SHARED(rcu_gp_ctr));
> -	smp_mb();
> +	cmm_smp_mb();
>  }
>  #endif  /* !(BITS_PER_LONG < 64) */
>  
> diff --git a/urcu-static.h b/urcu-static.h
> index eea39bb..ad415ac 100644
> --- a/urcu-static.h
> +++ b/urcu-static.h
> @@ -181,23 +181,23 @@ extern int has_sys_membarrier;
>  static inline void smp_mb_slave(int group)
>  {
>  	if (likely(has_sys_membarrier))
> -		barrier();
> +		cmm_barrier();
>  	else
> -		smp_mb();
> +		cmm_smp_mb();
>  }
>  #endif
>  
>  #ifdef RCU_MB
>  static inline void smp_mb_slave(int group)
>  {
> -	smp_mb();
> +	cmm_smp_mb();
>  }
>  #endif
>  
>  #ifdef RCU_SIGNAL
>  static inline void smp_mb_slave(int group)
>  {
> -	barrier();
> +	cmm_barrier();
>  }
>  #endif
>  
> @@ -259,7 +259,7 @@ static inline void _rcu_read_lock(void)
>  {
>  	unsigned long tmp;
>  
> -	barrier();	/* Ensure the compiler does not reorder us with mutex */
> +	cmm_barrier();	/* Ensure the compiler does not reorder us with mutex */
>  	tmp = rcu_reader.ctr;
>  	/*
>  	 * rcu_gp_ctr is
> @@ -295,7 +295,7 @@ static inline void _rcu_read_unlock(void)
>  	} else {
>  		_STORE_SHARED(rcu_reader.ctr, rcu_reader.ctr - RCU_GP_COUNT);
>  	}
> -	barrier();	/* Ensure the compiler does not reorder us with mutex */
> +	cmm_barrier();	/* Ensure the compiler does not reorder us with mutex */
>  }
>  
>  #ifdef __cplusplus
> diff --git a/urcu.c b/urcu.c
> index 918d274..9c556aa 100644
> --- a/urcu.c
> +++ b/urcu.c
> @@ -100,9 +100,9 @@ static void mutex_lock(pthread_mutex_t *mutex)
>  			exit(-1);
>  		}
>  		if (LOAD_SHARED(rcu_reader.need_mb)) {
> -			smp_mb();
> +			cmm_smp_mb();
>  			_STORE_SHARED(rcu_reader.need_mb, 0);
> -			smp_mb();
> +			cmm_smp_mb();
>  		}
>  		poll(NULL,0,10);
>  	}
> @@ -126,14 +126,14 @@ static void smp_mb_master(int group)
>  	if (likely(has_sys_membarrier))
>  		membarrier(MEMBARRIER_EXPEDITED);
>  	else
> -		smp_mb();
> +		cmm_smp_mb();
>  }
>  #endif
>  
>  #ifdef RCU_MB
>  static void smp_mb_master(int group)
>  {
> -	smp_mb();
> +	cmm_smp_mb();
>  }
>  #endif
>  
> @@ -143,15 +143,15 @@ static void force_mb_all_readers(void)
>  	struct rcu_reader *index;
>  
>  	/*
> -	 * Ask for each threads to execute a smp_mb() so we can consider the
> +	 * Ask for each threads to execute a cmm_smp_mb() so we can consider the
>  	 * compiler barriers around rcu read lock as real memory barriers.
>  	 */
>  	if (list_empty(&registry))
>  		return;
>  	/*
> -	 * pthread_kill has a smp_mb(). But beware, we assume it performs
> +	 * pthread_kill has a cmm_smp_mb(). But beware, we assume it performs
>  	 * a cache flush on architectures with non-coherent cache. Let's play
> -	 * safe and don't assume anything : we use smp_mc() to make sure the
> +	 * safe and don't assume anything : we use cmm_smp_mc() to make sure the
>  	 * cache flush is enforced.
>  	 */
>  	list_for_each_entry(index, &registry, node) {
> @@ -177,7 +177,7 @@ static void force_mb_all_readers(void)
>  			poll(NULL, 0, 1);
>  		}
>  	}
> -	smp_mb();	/* read ->need_mb before ending the barrier */
> +	cmm_smp_mb();	/* read ->need_mb before ending the barrier */
>  }
>  
>  static void smp_mb_master(int group)
> @@ -213,15 +213,15 @@ void update_counter_and_wait(void)
>  	 * while new readers are always accessing data (no progress). Enforce
>  	 * compiler-order of store to rcu_gp_ctr before load rcu_reader ctr.
>  	 */
> -	barrier();
> +	cmm_barrier();
>  
>  	/*
>  	 *
> -	 * Adding a smp_mb() which is _not_ formally required, but makes the
> +	 * Adding a cmm_smp_mb() which is _not_ formally required, but makes the
>  	 * model easier to understand. It does not have a big performance impact
>  	 * anyway, given this is the write-side.
>  	 */
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	/*
>  	 * Wait for each thread rcu_reader.ctr count to become 0.
> @@ -309,14 +309,14 @@ void synchronize_rcu(void)
>  	 * accessing data (no progress).  Enforce compiler-order of load
>  	 * rcu_reader ctr before store to rcu_gp_ctr.
>  	 */
> -	barrier();
> +	cmm_barrier();
>  
>  	/*
> -	 * Adding a smp_mb() which is _not_ formally required, but makes the
> +	 * Adding a cmm_smp_mb() which is _not_ formally required, but makes the
>  	 * model easier to understand. It does not have a big performance impact
>  	 * anyway, given this is the write-side.
>  	 */
> -	smp_mb();
> +	cmm_smp_mb();
>  
>  	/*
>  	 * Wait for previous parity to be empty of readers.
> @@ -379,13 +379,13 @@ void rcu_init(void)
>  static void sigrcu_handler(int signo, siginfo_t *siginfo, void *context)
>  {
>  	/*
> -	 * Executing this smp_mb() is the only purpose of this signal handler.
> -	 * It punctually promotes barrier() into smp_mb() on every thread it is
> +	 * Executing this cmm_smp_mb() is the only purpose of this signal handler.
> +	 * It punctually promotes cmm_barrier() into cmm_smp_mb() on every thread it is
>  	 * executed on.
>  	 */
> -	smp_mb();
> +	cmm_smp_mb();
>  	_STORE_SHARED(rcu_reader.need_mb, 0);
> -	smp_mb();
> +	cmm_smp_mb();
>  }
>  
>  /*
> diff --git a/urcu/arch_alpha.h b/urcu/arch_alpha.h
> index 0596939..51a1fff 100644
> --- a/urcu/arch_alpha.h
> +++ b/urcu/arch_alpha.h
> @@ -28,9 +28,9 @@
>  extern "C" {
>  #endif
>  
> -#define mb()			asm volatile("mb":::"memory")
> -#define wmb()			asm volatile("wmb":::"memory")
> -#define read_barrier_depends()	asm volatile("mb":::"memory")
> +#define cmm_mb()			asm volatile("mb":::"memory")
> +#define cmm_wmb()			asm volatile("wmb":::"memory")
> +#define cmm_read_barrier_depends()	asm volatile("mb":::"memory")
>  
>  typedef unsigned long long cycles_t;
>  
> diff --git a/urcu/arch_armv7l.h b/urcu/arch_armv7l.h
> index e63ad3c..6d58bb7 100644
> --- a/urcu/arch_armv7l.h
> +++ b/urcu/arch_armv7l.h
> @@ -29,7 +29,7 @@
>  extern "C" {
>  #endif 
>  
> -#define mb()    asm volatile("dmb":::"memory")
> +#define cmm_mb()    asm volatile("dmb":::"memory")
>  
>  #include <stdlib.h>
>  #include <sys/time.h>
> diff --git a/urcu/arch_generic.h b/urcu/arch_generic.h
> index 36a0003..25a9f7a 100644
> --- a/urcu/arch_generic.h
> +++ b/urcu/arch_generic.h
> @@ -32,93 +32,93 @@ extern "C" {
>  #define CACHE_LINE_SIZE	64
>  #endif
>  
> -#if !defined(mc) && !defined(rmc) && !defined(wmc)
> +#if !defined(cmm_mc) && !defined(cmm_rmc) && !defined(cmm_wmc)
>  #define CONFIG_HAVE_MEM_COHERENCY
>  /*
> - * Architectures with cache coherency must _not_ define mc/rmc/wmc.
> + * Architectures with cache coherency must _not_ define cmm_mc/cmm_rmc/cmm_wmc.
>   *
> - * For them, mc/rmc/wmc are implemented with a * simple compiler barrier;
> - * in addition, we provide defaults for mb (using GCC builtins) as well as
> - * rmb and wmb (defaulting to mb).
> + * For them, cmm_mc/cmm_rmc/cmm_wmc are implemented with a * simple compiler barrier;
> + * in addition, we provide defaults for cmm_mb (using GCC builtins) as well as
> + * cmm_rmb and cmm_wmb (defaulting to cmm_mb).
>   */
>  
> -#ifndef mb
> -#define mb()    __sync_synchronize()
> +#ifndef cmm_mb
> +#define cmm_mb()    __sync_synchronize()
>  #endif
>  
> -#ifndef rmb
> -#define rmb()    mb()
> +#ifndef cmm_rmb
> +#define cmm_rmb()	cmm_mb()
>  #endif
>  
> -#ifndef wmb
> -#define wmb()    mb()
> +#ifndef cmm_wmb
> +#define cmm_wmb()	cmm_mb()
>  #endif
>  
> -#define mc()	 barrier()
> -#define rmc()	 barrier()
> -#define wmc()	 barrier()
> +#define cmm_mc()	cmm_barrier()
> +#define cmm_rmc()	cmm_barrier()
> +#define cmm_wmc()	cmm_barrier()
>  #else
>  /*
>   * Architectures without cache coherency need something like the following:
>   *
> - * #define mc()		arch_cache_flush() 
> - * #define rmc()	arch_cache_flush_read()
> - * #define wmc()	arch_cache_flush_write()
> + * #define cmm_mc()		arch_cache_flush() 
> + * #define cmm_rmc()	arch_cache_flush_read()
> + * #define cmm_wmc()	arch_cache_flush_write()
>   *
> - * Of these, only mc is mandatory.  rmc and wmc default to mc.  mb/rmb/wmb
> - * use these definitions by default:
> + * Of these, only cmm_mc is mandatory.  cmm_rmc and cmm_wmc default to cmm_mc.  
> + * cmm_mb/cmm_rmb/cmm_wmb use these definitions by default:
>   *
> - * #define mb()		mc()
> - * #define rmb()	rmc()
> - * #define wmb()	wmc()
> + * #define cmm_mb()		cmm_mc()
> + * #define cmm_rmb()	cmm_rmc()
> + * #define cmm_wmb()	cmm_wmc()
>   */
>  
> -#ifndef mb
> -#define mb()    mc()
> +#ifndef cmm_mb
> +#define cmm_mb()	cmm_mc()
>  #endif
>  
> -#ifndef rmb
> -#define rmb()    rmc()
> +#ifndef cmm_rmb
> +#define cmm_rmb()	cmm_rmc()
>  #endif
>  
> -#ifndef wmb
> -#define wmb()    wmc()
> +#ifndef cmm_wmb
> +#define cmm_wmb()	cmm_wmc()
>  #endif
>  
> -#ifndef rmc
> -#define rmc()    mc()
> +#ifndef cmm_rmc
> +#define cmm_rmc()	cmm_mc()
>  #endif
>  
> -#ifndef wmc
> -#define wmc()    mc()
> +#ifndef cmm_wmc
> +#define cmm_wmc()	cmm_mc()
>  #endif
>  #endif
>  
>  /* Nop everywhere except on alpha. */
> -#ifndef read_barrier_depends
> -#define read_barrier_depends()
> +#ifndef cmm_read_barrier_depends
> +#define cmm_read_barrier_depends()
>  #endif
>  
>  #ifdef CONFIG_RCU_SMP
> -#define smp_mb()	mb()
> -#define smp_rmb()	rmb()
> -#define smp_wmb()	wmb()
> -#define smp_mc()	mc()
> -#define smp_rmc()	rmc()
> -#define smp_wmc()	wmc()
> -#define smp_read_barrier_depends()	read_barrier_depends()
> +#define cmm_smp_mb()	cmm_mb()
> +#define cmm_smp_rmb()	cmm_rmb()
> +#define cmm_smp_wmb()	cmm_wmb()
> +#define cmm_smp_mc()	cmm_mc()
> +#define cmm_smp_rmc()	cmm_rmc()
> +#define cmm_smp_wmc()	cmm_wmc()
> +#define cmm_smp_read_barrier_depends()	cmm_read_barrier_depends()
>  #else
> -#define smp_mb()	barrier()
> -#define smp_rmb()	barrier()
> -#define smp_wmb()	barrier()
> -#define smp_mc()	barrier()
> -#define smp_rmc()	barrier()
> -#define smp_wmc()	barrier()
> -#define smp_read_barrier_depends()
> +#define cmm_smp_mb()	cmm_barrier()
> +#define cmm_smp_rmb()	cmm_barrier()
> +#define cmm_smp_wmb()	cmm_barrier()
> +#define cmm_smp_mc()	cmm_barrier()
> +#define cmm_smp_rmc()	cmm_barrier()
> +#define cmm_smp_wmc()	cmm_barrier()
> +#define cmm_smp_read_barrier_depends()
>  #endif
>  
>  #ifndef cpu_relax
> -#define cpu_relax()	 barrier()
> +#define cpu_relax()		cmm_barrier()
>  #endif
>  
>  #ifdef __cplusplus
> diff --git a/urcu/arch_ppc.h b/urcu/arch_ppc.h
> index 7a217c8..93aed2a 100644
> --- a/urcu/arch_ppc.h
> +++ b/urcu/arch_ppc.h
> @@ -32,7 +32,7 @@ extern "C" {
>  /* Include size of POWER5+ L3 cache lines: 256 bytes */
>  #define CACHE_LINE_SIZE	256
>  
> -#define mb()    asm volatile("sync":::"memory")
> +#define cmm_mb()    asm volatile("sync":::"memory")
>  
>  #define mftbl()						\
>  	({ 						\
> @@ -56,9 +56,9 @@ static inline cycles_t get_cycles (void)
>  
>  	for (;;) {
>  		h = mftbu();
> -		barrier();
> +		cmm_barrier();
>  		l = mftbl();
> -		barrier();
> +		cmm_barrier();
>  		if (mftbu() == h)
>  			return (((cycles_t) h) << 32) + l;
>  	}
> diff --git a/urcu/arch_s390.h b/urcu/arch_s390.h
> index 1a55e0d..8a33e20 100644
> --- a/urcu/arch_s390.h
> +++ b/urcu/arch_s390.h
> @@ -37,7 +37,7 @@ extern "C" {
>  
>  #define CACHE_LINE_SIZE	128
>  
> -#define mb()    __asm__ __volatile__("bcr 15,0" : : : "memory")
> +#define cmm_mb()    __asm__ __volatile__("bcr 15,0" : : : "memory")
>  
>  typedef unsigned long long cycles_t;
>  
> diff --git a/urcu/arch_sparc64.h b/urcu/arch_sparc64.h
> index 8e991b1..39f27c7 100644
> --- a/urcu/arch_sparc64.h
> +++ b/urcu/arch_sparc64.h
> @@ -40,9 +40,9 @@ __asm__ __volatile__("ba,pt %%xcc, 1f\n\t"	\
>  		     "1:\n"			\
>  		     : : : "memory")
>  
> -#define mb()    membar_safe("#LoadLoad | #LoadStore | #StoreStore | #StoreLoad")
> -#define rmb()    membar_safe("#LoadLoad")
> -#define wmb()    membar_safe("#StoreStore")
> +#define cmm_mb()	membar_safe("#LoadLoad | #LoadStore | #StoreStore | #StoreLoad")
> +#define cmm_rmb()	membar_safe("#LoadLoad")
> +#define cmm_wmb()	membar_safe("#StoreStore")
>  
>  typedef unsigned long long cycles_t;
>  
> diff --git a/urcu/arch_x86.h b/urcu/arch_x86.h
> index aad541e..d0a58e8 100644
> --- a/urcu/arch_x86.h
> +++ b/urcu/arch_x86.h
> @@ -32,17 +32,17 @@ extern "C" {
>  #define CACHE_LINE_SIZE	128
>  
>  #ifdef CONFIG_RCU_HAVE_FENCE
> -#define mb()    asm volatile("mfence":::"memory")
> -#define rmb()   asm volatile("lfence":::"memory")
> -#define wmb()   asm volatile("sfence"::: "memory")
> +#define cmm_mb()    asm volatile("mfence":::"memory")
> +#define cmm_rmb()   asm volatile("lfence":::"memory")
> +#define cmm_wmb()   asm volatile("sfence"::: "memory")
>  #else
>  /*
> - * Some non-Intel clones support out of order store. wmb() ceases to be a
> + * Some non-Intel clones support out of order store. cmm_wmb() ceases to be a
>   * nop for these.
>   */
> -#define mb()    asm volatile("lock; addl $0,0(%%esp)":::"memory")
> -#define rmb()   asm volatile("lock; addl $0,0(%%esp)":::"memory")
> -#define wmb()   asm volatile("lock; addl $0,0(%%esp)"::: "memory")
> +#define cmm_mb()    asm volatile("lock; addl $0,0(%%esp)":::"memory")
> +#define cmm_rmb()   asm volatile("lock; addl $0,0(%%esp)":::"memory")
> +#define cmm_wmb()   asm volatile("lock; addl $0,0(%%esp)"::: "memory")
>  #endif
>  
>  #define cpu_relax()	asm volatile("rep; nop" : : : "memory");
> diff --git a/urcu/compiler.h b/urcu/compiler.h
> index fb8b829..d67e6c5 100644
> --- a/urcu/compiler.h
> +++ b/urcu/compiler.h
> @@ -23,7 +23,7 @@
>  #define likely(x)	__builtin_expect(!!(x), 1)
>  #define unlikely(x)	__builtin_expect(!!(x), 0)
>  
> -#define	barrier()	asm volatile("" : : : "memory")
> +#define	cmm_barrier()	asm volatile("" : : : "memory")
>  
>  /*
>   * Instruct the compiler to perform only a single access to a variable
> diff --git a/urcu/rcuhlist.h b/urcu/rcuhlist.h
> index 89f7679..cce80aa 100644
> --- a/urcu/rcuhlist.h
> +++ b/urcu/rcuhlist.h
> @@ -35,7 +35,7 @@ static inline void hlist_add_head_rcu(struct hlist_node *newp,
>  {
>  	newp->next = head->next;
>  	newp->prev = (struct hlist_node *)head;
> -	smp_wmb();
> +	cmm_smp_wmb();
>  	if (head->next)
>  		head->next->prev = newp;
>  	head->next = newp;
> diff --git a/urcu/rculist.h b/urcu/rculist.h
> index b0c4f1a..3a4e335 100644
> --- a/urcu/rculist.h
> +++ b/urcu/rculist.h
> @@ -34,7 +34,7 @@ static inline void list_add_rcu(list_t *newp, list_t *head)
>  {
>  	newp->next = head->next;
>  	newp->prev = head;
> -	smp_wmb();
> +	cmm_smp_wmb();
>  	head->next->prev = newp;
>  	head->next = newp;
>  }
> diff --git a/urcu/system.h b/urcu/system.h
> index 0de7dd2..11a499e 100644
> --- a/urcu/system.h
> +++ b/urcu/system.h
> @@ -22,7 +22,7 @@
>  #include <urcu/arch.h>
>  
>  /*
> - * Identify a shared load. A smp_rmc() or smp_mc() should come before the load.
> + * Identify a shared load. A cmm_smp_rmc() or cmm_smp_mc() should come before the load.
>   */
>  #define _LOAD_SHARED(p)	       ACCESS_ONCE(p)
>  
> @@ -31,12 +31,12 @@
>   */
>  #define LOAD_SHARED(p)			\
>  	({				\
> -		smp_rmc();		\
> +		cmm_smp_rmc();		\
>  		_LOAD_SHARED(p);	\
>  	})
>  
>  /*
> - * Identify a shared store. A smp_wmc() or smp_mc() should follow the store.
> + * Identify a shared store. A cmm_smp_wmc() or cmm_smp_mc() should follow the store.
>   */
>  #define _STORE_SHARED(x, v)	({ ACCESS_ONCE(x) = (v); })
>  
> @@ -47,7 +47,7 @@
>  #define STORE_SHARED(x, v)		\
>  	({				\
>  		typeof(x) _v = _STORE_SHARED(x, v);	\
> -		smp_wmc();		\
> +		cmm_smp_wmc();		\
>  		_v;			\
>  	})
>  
> -- 
> 1.7.3.2
> 
> 
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> 

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-18 20:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-18 20:31 [ltt-dev] [URCU PATCH 1/3] Rename all memory primitives with prefix cmm_ David Goulet
2010-11-18 20:31 ` [ltt-dev] [URCU PATCH 2/3] Rename all arch primitives with prefix caa_ David Goulet
2010-11-18 20:31 ` [ltt-dev] [URCU PATCH 3/3] Rename all data structure with prefix cds_ David Goulet
2010-11-18 20:57 ` [ltt-dev] [URCU PATCH 1/3] Rename all memory primitives with prefix cmm_ Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox