From 2a7ac59da1436b86d7cb59fb8b5712c7d98c1519 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sun, 21 Jun 2009 21:32:05 -0400 Subject: [PATCH] Deal with kernel affinity bug for tests Signed-off-by: Mathieu Desnoyers --- test_mutex.c | 42 +++++++++++++++++++++++--------- test_perthreadlock.c | 42 +++++++++++++++++++++++--------- test_qsbr.c | 58 +++++++++++++++++++++++--------------------- test_qsbr_gc.c | 42 +++++++++++++++++++++++--------- test_rwlock.c | 41 ++++++++++++++++++++++--------- test_urcu.c | 53 +++++++++++++++++++++++++++++++--------- test_urcu_gc.c | 42 +++++++++++++++++++++++--------- 7 files changed, 221 insertions(+), 99 deletions(-) diff --git a/test_mutex.c b/test_mutex.c index 8b48040..4cf1d32 100644 --- a/test_mutex.c +++ b/test_mutex.c @@ -38,6 +38,9 @@ /* Make this big enough to include the POWER5+ L3 cacheline size of 256B */ #define CACHE_LINE_SIZE 4096 +/* hardcoded number of CPUs */ +#define NR_CPUS 16384 + #if defined(_syscall0) _syscall0(pid_t, gettid) #elif defined(__NR_gettid) @@ -91,6 +94,26 @@ static int verbose_mode; printf(fmt, args); \ } while (0) +static unsigned int cpu_affinities[NR_CPUS]; +static unsigned int next_aff = 0; +static int use_affinity = 0; + +static void set_affinity(void) +{ + cpu_set_t mask; + int cpu; + + if (!use_affinity) + return; + + cpu = cpu_affinities[next_aff++]; + CPU_ZERO(&mask); + CPU_SET(cpu, &mask); + sched_setaffinity(0, sizeof(mask), &mask); +} + + + /* * returns 0 if test should end. */ @@ -145,6 +168,8 @@ void *thr_reader(void *data) printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", "reader", pthread_self(), (unsigned long)gettid()); + set_affinity(); + while (!test_go) { } @@ -174,6 +199,8 @@ void *thr_writer(void *data) printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", "writer", pthread_self(), (unsigned long)gettid()); + set_affinity(); + while (!test_go) { } @@ -210,8 +237,6 @@ void show_usage(int argc, char **argv) printf("\n"); } -cpu_set_t affinity; - int main(int argc, char **argv) { int err; @@ -220,7 +245,6 @@ int main(int argc, char **argv) unsigned long long *count_reader, *count_writer; unsigned long long tot_reads = 0, tot_writes = 0; int i, a; - int use_affinity = 0; if (argc < 4) { show_usage(argc, argv); @@ -246,8 +270,6 @@ int main(int argc, char **argv) return -1; } - CPU_ZERO(&affinity); - for (i = 4; i < argc; i++) { if (argv[i][0] != '-') continue; @@ -266,7 +288,7 @@ int main(int argc, char **argv) return -1; } a = atoi(argv[++i]); - CPU_SET(a, &affinity); + cpu_affinities[next_aff++] = a; use_affinity = 1; printf_verbose("Adding CPU %d affinity\n", a); break; @@ -297,12 +319,6 @@ int main(int argc, char **argv) printf_verbose("thread %-6s, thread id : %lx, tid %lu\n", "main", pthread_self(), (unsigned long)gettid()); - if (use_affinity - && sched_setaffinity(0, sizeof(affinity), &affinity) < 0) { - perror("sched_setaffinity"); - exit(-1); - } - tid_reader = malloc(sizeof(*tid_reader) * nr_readers); tid_writer = malloc(sizeof(*tid_writer) * nr_writers); count_reader = malloc(sizeof(*count_reader) * nr_readers); @@ -310,6 +326,8 @@ int main(int argc, char **argv) tot_nr_reads = malloc(sizeof(*tot_nr_reads) * nr_readers); tot_nr_writes = malloc(sizeof(*tot_nr_writes) * nr_writers); + next_aff = 0; + for (i = 0; i < nr_readers; i++) { err = pthread_create(&tid_reader[i], NULL, thr_reader, (void *)(long)i); diff --git a/test_perthreadlock.c b/test_perthreadlock.c index 3fc4a53..5bbe72b 100644 --- a/test_perthreadlock.c +++ b/test_perthreadlock.c @@ -38,6 +38,9 @@ /* Make this big enough to include the POWER5+ L3 cacheline size of 256B */ #define CACHE_LINE_SIZE 4096 +/* hardcoded number of CPUs */ +#define NR_CPUS 16384 + #if defined(_syscall0) _syscall0(pid_t, gettid) #elif defined(__NR_gettid) @@ -95,6 +98,26 @@ static int verbose_mode; printf(fmt, args); \ } while (0) +static unsigned int cpu_affinities[NR_CPUS]; +static unsigned int next_aff = 0; +static int use_affinity = 0; + +static void set_affinity(void) +{ + cpu_set_t mask; + int cpu; + + if (!use_affinity) + return; + + cpu = cpu_affinities[next_aff++]; + CPU_ZERO(&mask); + CPU_SET(cpu, &mask); + sched_setaffinity(0, sizeof(mask), &mask); +} + + + /* * returns 0 if test should end. */ @@ -149,6 +172,8 @@ void *thr_reader(void *data) printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", "reader", pthread_self(), (unsigned long)gettid()); + set_affinity(); + while (!test_go) { } @@ -179,6 +204,8 @@ void *thr_writer(void *data) printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", "writer", pthread_self(), (unsigned long)gettid()); + set_affinity(); + while (!test_go) { } @@ -219,8 +246,6 @@ void show_usage(int argc, char **argv) printf("\n"); } -cpu_set_t affinity; - int main(int argc, char **argv) { int err; @@ -229,7 +254,6 @@ int main(int argc, char **argv) unsigned long long *count_reader, *count_writer; unsigned long long tot_reads = 0, tot_writes = 0; int i, a; - int use_affinity = 0; if (argc < 4) { show_usage(argc, argv); @@ -255,8 +279,6 @@ int main(int argc, char **argv) return -1; } - CPU_ZERO(&affinity); - for (i = 4; i < argc; i++) { if (argv[i][0] != '-') continue; @@ -275,7 +297,7 @@ int main(int argc, char **argv) return -1; } a = atoi(argv[++i]); - CPU_SET(a, &affinity); + cpu_affinities[next_aff++] = a; use_affinity = 1; printf_verbose("Adding CPU %d affinity\n", a); break; @@ -306,12 +328,6 @@ int main(int argc, char **argv) printf_verbose("thread %-6s, thread id : %lx, tid %lu\n", "main", pthread_self(), (unsigned long)gettid()); - if (use_affinity - && sched_setaffinity(0, sizeof(affinity), &affinity) < 0) { - perror("sched_setaffinity"); - exit(-1); - } - tid_reader = malloc(sizeof(*tid_reader) * nr_readers); tid_writer = malloc(sizeof(*tid_writer) * nr_writers); count_reader = malloc(sizeof(*count_reader) * nr_readers); @@ -320,6 +336,8 @@ int main(int argc, char **argv) tot_nr_writes = malloc(sizeof(*tot_nr_writes) * nr_writers); per_thread_lock = malloc(sizeof(*per_thread_lock) * nr_readers); + next_aff = 0; + for (i = 0; i < nr_readers; i++) { err = pthread_create(&tid_reader[i], NULL, thr_reader, (void *)(long)i); diff --git a/test_qsbr.c b/test_qsbr.c index 6830fe1..af5ccfd 100644 --- a/test_qsbr.c +++ b/test_qsbr.c @@ -38,6 +38,9 @@ /* Make this big enough to include the POWER5+ L3 cacheline size of 256B */ #define CACHE_LINE_SIZE 4096 +/* hardcoded number of CPUs */ +#define NR_CPUS 16384 + #if defined(_syscall0) _syscall0(pid_t, gettid) #elif defined(__NR_gettid) @@ -85,6 +88,26 @@ static int verbose_mode; printf(fmt, args); \ } while (0) +static unsigned int cpu_affinities[NR_CPUS]; +static unsigned int next_aff = 0; +static int use_affinity = 0; + +static void set_affinity(void) +{ + cpu_set_t mask; + int cpu; + + if (!use_affinity) + return; + + cpu = cpu_affinities[next_aff++]; + CPU_ZERO(&mask); + CPU_SET(cpu, &mask); + sched_setaffinity(0, sizeof(mask), &mask); +} + + + /* * returns 0 if test should end. */ @@ -171,6 +194,8 @@ void *thr_reader(void *_count) printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", "reader", pthread_self(), (unsigned long)gettid()); + set_affinity(); + rcu_register_thread(); while (!test_go) @@ -212,6 +237,8 @@ void *thr_writer(void *_count) printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", "writer", pthread_self(), (unsigned long)gettid()); + set_affinity(); + while (!test_go) { } @@ -256,8 +283,6 @@ void show_usage(int argc, char **argv) printf("\n"); } -cpu_set_t affinity; - int main(int argc, char **argv) { int err; @@ -266,7 +291,6 @@ int main(int argc, char **argv) unsigned long long *count_reader, *count_writer; unsigned long long tot_reads = 0, tot_writes = 0; int i, a; - int use_affinity = 0; if (argc < 4) { show_usage(argc, argv); @@ -291,8 +315,6 @@ int main(int argc, char **argv) return -1; } - CPU_ZERO(&affinity); - for (i = 4; i < argc; i++) { if (argv[i][0] != '-') continue; @@ -311,7 +333,7 @@ int main(int argc, char **argv) return -1; } a = atoi(argv[++i]); - CPU_SET(a, &affinity); + cpu_affinities[next_aff++] = a; use_affinity = 1; printf_verbose("Adding CPU %d affinity\n", a); break; @@ -342,34 +364,14 @@ int main(int argc, char **argv) printf_verbose("thread %-6s, thread id : %lx, tid %lu\n", "main", pthread_self(), (unsigned long)gettid()); - if (use_affinity) { - for (i = 0; i < CPU_SETSIZE; i++) - if (CPU_ISSET(i, &affinity)) - printf_verbose("About to set affinity " - "to CPU : %d\n", i); - - if (sched_setaffinity(0, sizeof(affinity), &affinity) < 0) { - perror("sched_setaffinity"); - exit(-1); - } - - if (sched_getaffinity(0, sizeof(affinity), &affinity) < 0) { - perror("sched_getaffinity"); - exit(-1); - } - - for (i = 0; i < CPU_SETSIZE; i++) - if (CPU_ISSET(i, &affinity)) - printf_verbose("Effectively set affinity " - "to CPU : %d\n", i); - } - test_array = malloc(sizeof(*test_array) * ARRAY_SIZE); tid_reader = malloc(sizeof(*tid_reader) * nr_readers); tid_writer = malloc(sizeof(*tid_writer) * nr_writers); count_reader = malloc(sizeof(*count_reader) * nr_readers); count_writer = malloc(sizeof(*count_writer) * nr_writers); + next_aff = 0; + for (i = 0; i < nr_readers; i++) { err = pthread_create(&tid_reader[i], NULL, thr_reader, &count_reader[i]); diff --git a/test_qsbr_gc.c b/test_qsbr_gc.c index c5cb9b1..0b2d5df 100644 --- a/test_qsbr_gc.c +++ b/test_qsbr_gc.c @@ -38,6 +38,9 @@ /* Make this big enough to include the POWER5+ L3 cacheline size of 256B */ #define CACHE_LINE_SIZE 4096 +/* hardcoded number of CPUs */ +#define NR_CPUS 16384 + #if defined(_syscall0) _syscall0(pid_t, gettid) #elif defined(__NR_gettid) @@ -94,6 +97,26 @@ static int verbose_mode; printf(fmt, args); \ } while (0) +static unsigned int cpu_affinities[NR_CPUS]; +static unsigned int next_aff = 0; +static int use_affinity = 0; + +static void set_affinity(void) +{ + cpu_set_t mask; + int cpu; + + if (!use_affinity) + return; + + cpu = cpu_affinities[next_aff++]; + CPU_ZERO(&mask); + CPU_SET(cpu, &mask); + sched_setaffinity(0, sizeof(mask), &mask); +} + + + /* * returns 0 if test should end. */ @@ -147,6 +170,8 @@ void *thr_reader(void *_count) printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", "reader", pthread_self(), (unsigned long)gettid()); + set_affinity(); + rcu_register_thread(); while (!test_go) @@ -219,6 +244,8 @@ void *thr_writer(void *data) printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", "writer", pthread_self(), (unsigned long)gettid()); + set_affinity(); + while (!test_go) { } @@ -260,8 +287,6 @@ void show_usage(int argc, char **argv) printf("\n"); } -cpu_set_t affinity; - int main(int argc, char **argv) { int err; @@ -270,7 +295,6 @@ int main(int argc, char **argv) unsigned long long *count_reader; unsigned long long tot_reads = 0, tot_writes = 0; int i, a; - int use_affinity = 0; if (argc < 4) { show_usage(argc, argv); @@ -295,8 +319,6 @@ int main(int argc, char **argv) return -1; } - CPU_ZERO(&affinity); - for (i = 4; i < argc; i++) { if (argv[i][0] != '-') continue; @@ -315,7 +337,7 @@ int main(int argc, char **argv) return -1; } a = atoi(argv[++i]); - CPU_SET(a, &affinity); + cpu_affinities[next_aff++] = a; use_affinity = 1; printf_verbose("Adding CPU %d affinity\n", a); break; @@ -353,12 +375,6 @@ int main(int argc, char **argv) printf_verbose("thread %-6s, thread id : %lx, tid %lu\n", "main", pthread_self(), (unsigned long)gettid()); - if (use_affinity - && sched_setaffinity(0, sizeof(affinity), &affinity) < 0) { - perror("sched_setaffinity"); - exit(-1); - } - tid_reader = malloc(sizeof(*tid_reader) * nr_readers); tid_writer = malloc(sizeof(*tid_writer) * nr_writers); count_reader = malloc(sizeof(*count_reader) * nr_readers); @@ -375,6 +391,8 @@ int main(int argc, char **argv) for (i = 0; i < nr_writers; i++) pending_reclaims[i].head = pending_reclaims[i].queue; + next_aff = 0; + for (i = 0; i < nr_readers; i++) { err = pthread_create(&tid_reader[i], NULL, thr_reader, &count_reader[i]); diff --git a/test_rwlock.c b/test_rwlock.c index 733263b..b790901 100644 --- a/test_rwlock.c +++ b/test_rwlock.c @@ -38,6 +38,9 @@ /* Make this big enough to include the POWER5+ L3 cacheline size of 256B */ #define CACHE_LINE_SIZE 4096 +/* hardcoded number of CPUs */ +#define NR_CPUS 16384 + #if defined(_syscall0) _syscall0(pid_t, gettid) #elif defined(__NR_gettid) @@ -91,6 +94,26 @@ static int verbose_mode; printf(fmt, args); \ } while (0) +static unsigned int cpu_affinities[NR_CPUS]; +static unsigned int next_aff = 0; +static int use_affinity = 0; + +static void set_affinity(void) +{ + cpu_set_t mask; + int cpu; + + if (!use_affinity) + return; + + cpu = cpu_affinities[next_aff++]; + CPU_ZERO(&mask); + CPU_SET(cpu, &mask); + sched_setaffinity(0, sizeof(mask), &mask); +} + + + /* * returns 0 if test should end. */ @@ -140,6 +163,8 @@ void *thr_reader(void *_count) printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", "reader", pthread_self(), (unsigned long)gettid()); + set_affinity(); + while (!test_go) { } @@ -169,6 +194,8 @@ void *thr_writer(void *_count) printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", "writer", pthread_self(), (unsigned long)gettid()); + set_affinity(); + while (!test_go) { } @@ -205,8 +232,6 @@ void show_usage(int argc, char **argv) printf("\n"); } -cpu_set_t affinity; - int main(int argc, char **argv) { int err; @@ -215,7 +240,6 @@ int main(int argc, char **argv) unsigned long long *count_reader, *count_writer; unsigned long long tot_reads = 0, tot_writes = 0; int i, a; - int use_affinity = 0; if (argc < 4) { show_usage(argc, argv); @@ -241,8 +265,6 @@ int main(int argc, char **argv) return -1; } - CPU_ZERO(&affinity); - for (i = 4; i < argc; i++) { if (argv[i][0] != '-') continue; @@ -261,7 +283,7 @@ int main(int argc, char **argv) return -1; } a = atoi(argv[++i]); - CPU_SET(a, &affinity); + cpu_affinities[next_aff++] = a; use_affinity = 1; printf_verbose("Adding CPU %d affinity\n", a); break; @@ -291,17 +313,14 @@ int main(int argc, char **argv) printf_verbose("Reader duration : %lu loops.\n", rduration); printf_verbose("thread %-6s, thread id : %lx, tid %lu\n", "main", pthread_self(), (unsigned long)gettid()); - if (use_affinity - && sched_setaffinity(0, sizeof(affinity), &affinity) < 0) { - perror("sched_setaffinity"); - exit(-1); - } tid_reader = malloc(sizeof(*tid_reader) * nr_readers); tid_writer = malloc(sizeof(*tid_writer) * nr_writers); count_reader = malloc(sizeof(*count_reader) * nr_readers); count_writer = malloc(sizeof(*count_writer) * nr_writers); + next_aff = 0; + for (i = 0; i < nr_readers; i++) { err = pthread_create(&tid_reader[i], NULL, thr_reader, &count_reader[i]); diff --git a/test_urcu.c b/test_urcu.c index fc9e8b5..96dac98 100644 --- a/test_urcu.c +++ b/test_urcu.c @@ -38,6 +38,9 @@ /* Make this big enough to include the POWER5+ L3 cacheline size of 256B */ #define CACHE_LINE_SIZE 4096 +/* hardcoded number of CPUs */ +#define NR_CPUS 16384 + #if defined(_syscall0) _syscall0(pid_t, gettid) #elif defined(__NR_gettid) @@ -89,6 +92,37 @@ static int verbose_mode; printf(fmt, args); \ } while (0) +static unsigned int cpu_affinities[NR_CPUS]; +static unsigned int next_aff = 0; +static int use_affinity = 0; + +pthread_mutex_t affinity_mutex = PTHREAD_MUTEX_INITIALIZER; + +static void set_affinity(void) +{ + cpu_set_t mask; + int cpu; + int ret; + + if (!use_affinity) + return; + + ret = pthread_mutex_lock(&affinity_mutex); + if (ret) { + perror("Error in pthread mutex lock"); + exit(-1); + } + cpu = cpu_affinities[next_aff++]; + ret = pthread_mutex_unlock(&affinity_mutex); + if (ret) { + perror("Error in pthread mutex unlock"); + exit(-1); + } + CPU_ZERO(&mask); + CPU_SET(cpu, &mask); + sched_setaffinity(0, sizeof(mask), &mask); +} + /* * returns 0 if test should end. */ @@ -175,6 +209,8 @@ void *thr_reader(void *_count) printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", "reader", pthread_self(), (unsigned long)gettid()); + set_affinity(); + rcu_register_thread(); while (!test_go) @@ -213,6 +249,8 @@ void *thr_writer(void *_count) printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", "writer", pthread_self(), (unsigned long)gettid()); + set_affinity(); + while (!test_go) { } @@ -257,8 +295,6 @@ void show_usage(int argc, char **argv) printf("\n"); } -cpu_set_t affinity; - int main(int argc, char **argv) { int err; @@ -267,7 +303,6 @@ int main(int argc, char **argv) unsigned long long *count_reader, *count_writer; unsigned long long tot_reads = 0, tot_writes = 0; int i, a; - int use_affinity = 0; if (argc < 4) { show_usage(argc, argv); @@ -292,8 +327,6 @@ int main(int argc, char **argv) return -1; } - CPU_ZERO(&affinity); - for (i = 4; i < argc; i++) { if (argv[i][0] != '-') continue; @@ -312,7 +345,7 @@ int main(int argc, char **argv) return -1; } a = atoi(argv[++i]); - CPU_SET(a, &affinity); + cpu_affinities[next_aff++] = a; use_affinity = 1; printf_verbose("Adding CPU %d affinity\n", a); break; @@ -343,18 +376,14 @@ int main(int argc, char **argv) printf_verbose("thread %-6s, thread id : %lx, tid %lu\n", "main", pthread_self(), (unsigned long)gettid()); - if (use_affinity - && sched_setaffinity(0, sizeof(affinity), &affinity) < 0) { - perror("sched_setaffinity"); - exit(-1); - } - test_array = malloc(sizeof(*test_array) * ARRAY_SIZE); tid_reader = malloc(sizeof(*tid_reader) * nr_readers); tid_writer = malloc(sizeof(*tid_writer) * nr_writers); count_reader = malloc(sizeof(*count_reader) * nr_readers); count_writer = malloc(sizeof(*count_writer) * nr_writers); + next_aff = 0; + for (i = 0; i < nr_readers; i++) { err = pthread_create(&tid_reader[i], NULL, thr_reader, &count_reader[i]); diff --git a/test_urcu_gc.c b/test_urcu_gc.c index ee936f0..f1cce24 100644 --- a/test_urcu_gc.c +++ b/test_urcu_gc.c @@ -38,6 +38,9 @@ /* Make this big enough to include the POWER5+ L3 cacheline size of 256B */ #define CACHE_LINE_SIZE 4096 +/* hardcoded number of CPUs */ +#define NR_CPUS 16384 + #if defined(_syscall0) _syscall0(pid_t, gettid) #elif defined(__NR_gettid) @@ -98,6 +101,26 @@ static int verbose_mode; printf(fmt, args); \ } while (0) +static unsigned int cpu_affinities[NR_CPUS]; +static unsigned int next_aff = 0; +static int use_affinity = 0; + +static void set_affinity(void) +{ + cpu_set_t mask; + int cpu; + + if (!use_affinity) + return; + + cpu = cpu_affinities[next_aff++]; + CPU_ZERO(&mask); + CPU_SET(cpu, &mask); + sched_setaffinity(0, sizeof(mask), &mask); +} + + + /* * returns 0 if test should end. */ @@ -151,6 +174,8 @@ void *thr_reader(void *_count) printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", "reader", pthread_self(), (unsigned long)gettid()); + set_affinity(); + rcu_register_thread(); while (!test_go) @@ -220,6 +245,8 @@ void *thr_writer(void *data) printf_verbose("thread_begin %s, thread id : %lx, tid %lu\n", "writer", pthread_self(), (unsigned long)gettid()); + set_affinity(); + while (!test_go) { } @@ -261,8 +288,6 @@ void show_usage(int argc, char **argv) printf("\n"); } -cpu_set_t affinity; - int main(int argc, char **argv) { int err; @@ -271,7 +296,6 @@ int main(int argc, char **argv) unsigned long long *count_reader; unsigned long long tot_reads = 0, tot_writes = 0; int i, a; - int use_affinity = 0; if (argc < 4) { show_usage(argc, argv); @@ -296,8 +320,6 @@ int main(int argc, char **argv) return -1; } - CPU_ZERO(&affinity); - for (i = 4; i < argc; i++) { if (argv[i][0] != '-') continue; @@ -316,7 +338,7 @@ int main(int argc, char **argv) return -1; } a = atoi(argv[++i]); - CPU_SET(a, &affinity); + cpu_affinities[next_aff++] = a; use_affinity = 1; printf_verbose("Adding CPU %d affinity\n", a); break; @@ -354,12 +376,6 @@ int main(int argc, char **argv) printf_verbose("thread %-6s, thread id : %lx, tid %lu\n", "main", pthread_self(), (unsigned long)gettid()); - if (use_affinity - && sched_setaffinity(0, sizeof(affinity), &affinity) < 0) { - perror("sched_setaffinity"); - exit(-1); - } - tid_reader = malloc(sizeof(*tid_reader) * nr_readers); tid_writer = malloc(sizeof(*tid_writer) * nr_writers); count_reader = malloc(sizeof(*count_reader) * nr_readers); @@ -376,6 +392,8 @@ int main(int argc, char **argv) for (i = 0; i < nr_writers; i++) pending_reclaims[i].head = pending_reclaims[i].queue; + next_aff = 0; + for (i = 0; i < nr_readers; i++) { err = pthread_create(&tid_reader[i], NULL, thr_reader, &count_reader[i]); -- 2.34.1