Commit 6b558c4c authored by Paul E. McKenney's avatar Paul E. McKenney

rcutorture: Bind rcuperf reader/writer kthreads to CPUs

This commit forces more deterministic behavior by binding rcuperf's
rcu_perf_reader() and rcu_perf_writer() kthreads to their respective
CPUs.
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent bdea9e34
...@@ -328,8 +328,10 @@ rcu_perf_reader(void *arg) ...@@ -328,8 +328,10 @@ rcu_perf_reader(void *arg)
{ {
unsigned long flags; unsigned long flags;
int idx; int idx;
long me = (long)arg;
VERBOSE_PERFOUT_STRING("rcu_perf_reader task started"); VERBOSE_PERFOUT_STRING("rcu_perf_reader task started");
set_cpus_allowed_ptr(current, cpumask_of(me % nr_cpu_ids));
set_user_nice(current, MAX_NICE); set_user_nice(current, MAX_NICE);
atomic_inc(&n_rcu_perf_reader_started); atomic_inc(&n_rcu_perf_reader_started);
...@@ -362,6 +364,7 @@ rcu_perf_writer(void *arg) ...@@ -362,6 +364,7 @@ rcu_perf_writer(void *arg)
WARN_ON(rcu_gp_is_expedited() && !rcu_gp_is_normal() && !gp_exp); WARN_ON(rcu_gp_is_expedited() && !rcu_gp_is_normal() && !gp_exp);
WARN_ON(rcu_gp_is_normal() && gp_exp); WARN_ON(rcu_gp_is_normal() && gp_exp);
WARN_ON(!wdpp); WARN_ON(!wdpp);
set_cpus_allowed_ptr(current, cpumask_of(me % nr_cpu_ids));
t = ktime_get_mono_fast_ns(); t = ktime_get_mono_fast_ns();
if (atomic_inc_return(&n_rcu_perf_writer_started) >= nrealwriters) { if (atomic_inc_return(&n_rcu_perf_writer_started) >= nrealwriters) {
t_rcu_perf_writer_started = t; t_rcu_perf_writer_started = t;
...@@ -594,7 +597,7 @@ rcu_perf_init(void) ...@@ -594,7 +597,7 @@ rcu_perf_init(void)
goto unwind; goto unwind;
} }
for (i = 0; i < nrealreaders; i++) { for (i = 0; i < nrealreaders; i++) {
firsterr = torture_create_kthread(rcu_perf_reader, NULL, firsterr = torture_create_kthread(rcu_perf_reader, (void *)i,
reader_tasks[i]); reader_tasks[i]);
if (firsterr) if (firsterr)
goto unwind; goto unwind;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment