X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Ftest_qsbr_gc.c;h=0c1c124ae6773e07c203d6e4b219272b8589de39;hp=1d74d1ad379c6c2fbe8361e7a52cc0c812d4a5e7;hb=1f689e13ea7e519b1afc001e9c55a7b1b60b599f;hpb=a50a7b4333a5039f1471c0b7cfbfb3d6dc5379fb diff --git a/tests/test_qsbr_gc.c b/tests/test_qsbr_gc.c index 1d74d1a..0c1c124 100644 --- a/tests/test_qsbr_gc.c +++ b/tests/test_qsbr_gc.c @@ -3,7 +3,7 @@ * * Userspace RCU library - test program (with baatch reclamation) * - * Copyright February 2009 - Mathieu Desnoyers + * Copyright February 2009 - Mathieu Desnoyers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,12 +31,15 @@ #include #include #include -#include #include #include #include +#ifdef __linux__ +#include +#endif + /* hardcoded number of CPUs */ #define NR_CPUS 16384 @@ -88,7 +91,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 +167,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) @@ -203,7 +206,7 @@ void *thr_reader(void *_count) while (!test_go) { } - smp_mb(); + cmm_smp_mb(); for (;;) { _rcu_read_lock(); @@ -279,7 +282,7 @@ void *thr_writer(void *data) while (!test_go) { } - smp_mb(); + cmm_smp_mb(); for (;;) { #ifndef TEST_LOCAL_GC @@ -419,9 +422,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, @@ -444,7 +447,7 @@ int main(int argc, char **argv) exit(1); } - smp_mb(); + cmm_smp_mb(); test_go = 1;