Fix typo in license file
[urcu.git] / test_perthreadlock_timing.c
index 625f999daf4d404ce1af78f3ebb1909e18d2da2a..3e8268b6d7085c15d6a5de4ee1124ebcac77efca 100644 (file)
@@ -33,6 +33,9 @@
 #include <pthread.h>
 #include <arch.h>
 
+/* Make this big enough to include the POWER5+ L3 cacheline size of 256B */
+#define CACHE_LINE_SIZE 4096
+
 #if defined(_syscall0)
 _syscall0(pid_t, gettid)
 #elif defined(__NR_gettid)
@@ -58,7 +61,7 @@ static struct test_array test_array = { 8 };
 
 struct per_thread_lock {
        pthread_mutex_t lock;
-} __attribute__((aligned(128)));       /* cache-line aligned */
+} __attribute__((aligned(CACHE_LINE_SIZE)));   /* cache-line aligned */
 
 static struct per_thread_lock *per_thread_lock;
 
@@ -76,8 +79,8 @@ static int num_write;
 #define NR_READ num_read
 #define NR_WRITE num_write
 
-static cycles_t __attribute__((aligned(128))) *reader_time;
-static cycles_t __attribute__((aligned(128))) *writer_time;
+static cycles_t __attribute__((aligned(CACHE_LINE_SIZE))) *reader_time;
+static cycles_t __attribute__((aligned(CACHE_LINE_SIZE))) *writer_time;
 
 void *thr_reader(void *arg)
 {
This page took 0.023315 seconds and 4 git commands to generate.