|
|
@ -48,6 +48,23 @@ static ck_sequence_t seqlock CK_CC_CACHELINE = CK_SEQUENCE_INITIALIZER;
|
|
|
|
static unsigned int barrier;
|
|
|
|
static unsigned int barrier;
|
|
|
|
static struct affinity affinerator;
|
|
|
|
static struct affinity affinerator;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
|
|
|
validate(struct example *copy)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (copy->b != copy->a + 1000) {
|
|
|
|
|
|
|
|
ck_error("ERROR: Failed regression: copy->b (%u != %u + %u / %u)\n",
|
|
|
|
|
|
|
|
copy->b, copy->a, 1000, copy->a + 1000);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (copy->c != copy->a + copy->b) {
|
|
|
|
|
|
|
|
ck_error("ERROR: Failed regression: copy->c (%u != %u + %u / %u)\n",
|
|
|
|
|
|
|
|
copy->c, copy->a, copy->b, copy->a + copy->b);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void *
|
|
|
|
static void *
|
|
|
|
consumer(void *unused CK_CC_UNUSED)
|
|
|
|
consumer(void *unused CK_CC_UNUSED)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -77,14 +94,15 @@ consumer(void *unused CK_CC_UNUSED)
|
|
|
|
copy.c = ck_pr_load_uint(&global.c);
|
|
|
|
copy.c = ck_pr_load_uint(&global.c);
|
|
|
|
retries++;
|
|
|
|
retries++;
|
|
|
|
} while (ck_sequence_read_retry(&seqlock, version) == true);
|
|
|
|
} while (ck_sequence_read_retry(&seqlock, version) == true);
|
|
|
|
|
|
|
|
validate(©);
|
|
|
|
|
|
|
|
|
|
|
|
if (copy.b != copy.a + 1000) {
|
|
|
|
CK_SEQUENCE_READ(&seqlock, &version) {
|
|
|
|
ck_error("ERROR: Failed regression: copy.b (%u != %u + %u / %u)\n", copy.b, copy.a, 1000, copy.a + 1000);
|
|
|
|
copy.a = ck_pr_load_uint(&global.a);
|
|
|
|
}
|
|
|
|
copy.b = ck_pr_load_uint(&global.b);
|
|
|
|
|
|
|
|
copy.c = ck_pr_load_uint(&global.c);
|
|
|
|
if (copy.c != copy.a + copy.b) {
|
|
|
|
retries++;
|
|
|
|
ck_error("ERROR: Failed regression: copy.c (%u != %u + %u / %u)\n", copy.c, copy.a, copy.b, copy.a + copy.b);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
validate(©);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fprintf(stderr, "%u retries.\n", retries - STEPS);
|
|
|
|
fprintf(stderr, "%u retries.\n", retries - STEPS);
|
|
|
|