void run_rcu_stress(struct maple_tree *mt, struct rcu_test_struct *vals)
{
- int i, count, max = 15000;
+ int i, count;
void *(*function)(void*);
- pthread_t readers[50];
+ pthread_t readers[100];
bool toggle = true;
void *expected = xa_mk_value(vals->toggle/10);
xa_mk_value(vals->removed/10), GFP_KERNEL);
for (i = 0; i < ARRAY_SIZE(readers); i++) {
- if (i < 9)
+ if (i < 19)
function = rcu_empty;
- else if (i < 19)
+ else if (i < 39)
function = rcu_present;
- else if (i < 29)
+ else if (i < 59)
function = rcu_added;
- else if (i < 39)
+ else if (i < 79)
function = rcu_removed;
else
function = rcu_toggle;
}
}
- usleep(5); /* small yield to ensure all threads are at least started. */
- for (count = 0; count < max; count++) {
+ usleep(2); /* small yield to ensure all threads are at least started. */
+ for (count = 0; count < vals->count; count++) {
/* Add and modify */
mtree_store_range(mt, vals->index, vals->last,
count % 2 ? vals->entry2 : vals->entry3,
mtree_store_range(mt, vals->toggle, vals->toggle, NULL,
GFP_KERNEL);
}
- usleep(5);
+ usleep(50);
}
while (i--)
pthread_join(readers[i], NULL);
/* 4390-4395: value 439 (0x1b7) [0x36f] */
/* Store across several slots. */
/* Spanning store. */
- vals.loop_sleep = 3;
- vals.count = 10000;
+ vals.loop_sleep = 7;
+ vals.count = 15000;
vals.mt = mt;
vals.index = 4390;
vals.last = 4398;