diff --git a/regressions/ck_hp/validate/ck_hp_stack.c b/regressions/ck_hp/validate/ck_hp_stack.c index 752afdc..878b0a8 100644 --- a/regressions/ck_hp/validate/ck_hp_stack.c +++ b/regressions/ck_hp/validate/ck_hp_stack.c @@ -34,17 +34,6 @@ #include #include -#ifdef __linux__ -#include -#include -#include -#include -#endif - -#ifndef CORES -#define CORES 8 -#endif - #include #include #include @@ -54,6 +43,8 @@ #include #include +#include "../../common.h" + static unsigned int threshold; static unsigned int n_threads; static unsigned int barrier; @@ -70,46 +61,9 @@ struct node { }; static ck_stack_t stack = {NULL, NULL}; static ck_hp_t stack_hp; - CK_STACK_CONTAINER(struct node, stack_entry, stack_container) - -struct affinity { - uint32_t delta; - uint32_t request; -}; - static struct affinity a; -#ifdef __linux__ -#ifndef gettid -static pid_t -gettid(void) -{ - return syscall(__NR_gettid); -} -#endif - -static int -aff_iterate(struct affinity *acb) -{ - cpu_set_t s; - int c; - - c = ck_pr_faa_uint(&acb->request, acb->delta); - CPU_ZERO(&s); - CPU_SET(c % CORES, &s); - - return sched_setaffinity(gettid(), sizeof(s), &s); -} -#else -static int -aff_iterate(struct affinity *acb) -{ - acb = NULL; - return (0); -} -#endif - static void * thread(void *unused) { diff --git a/src/ck_hp.c b/src/ck_hp.c index bb6dfb9..1dea2ce 100644 --- a/src/ck_hp.c +++ b/src/ck_hp.c @@ -173,7 +173,7 @@ ck_hp_member_scan(ck_stack_entry_t *entry, unsigned int degree, void *pointer) if (hazard == pointer) return (true); } - } while (entry = CK_STACK_NEXT(entry)); + } while ((entry = CK_STACK_NEXT(entry)) != NULL); return (false); }