summaryrefslogtreecommitdiffstats
path: root/include/linux/torture.h
diff options
context:
space:
mode:
authorPaul E. McKenney2018-05-22 20:38:47 +0200
committerPaul E. McKenney2018-07-13 00:42:04 +0200
commit3025520ec424df8b0fd5cdc319ad6b83406d9954 (patch)
treec58744959ebe2755b9c5dcb6b78049eaa6f866f1 /include/linux/torture.h
parentrcutorture: Use atomic increment for n_rcu_torture_timers (diff)
downloadkernel-qcow2-linux-3025520ec424df8b0fd5cdc319ad6b83406d9954.tar.gz
kernel-qcow2-linux-3025520ec424df8b0fd5cdc319ad6b83406d9954.tar.xz
kernel-qcow2-linux-3025520ec424df8b0fd5cdc319ad6b83406d9954.zip
rcutorture: Use per-CPU random state for rcu_torture_timer()
Currently, the rcu_torture_timer() function uses a single global torture_random_state structure protected by a single global lock. This conflicts to some extent with performance and scalability, but even more with the goal of consolidating read-side testing with rcu_torture_reader(). This commit therefore creates a per-CPU torture_random_state structure for use by rcu_torture_timer() and eliminates the lock. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> [ paulmck: Make rcu_torture_timer_rand static, per 0day Test Robot report. ]
Diffstat (limited to 'include/linux/torture.h')
-rw-r--r--include/linux/torture.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/torture.h b/include/linux/torture.h
index a55e80817dae..61dfd93b6ee4 100644
--- a/include/linux/torture.h
+++ b/include/linux/torture.h
@@ -64,6 +64,8 @@ struct torture_random_state {
long trs_count;
};
#define DEFINE_TORTURE_RANDOM(name) struct torture_random_state name = { 0, 0 }
+#define DEFINE_TORTURE_RANDOM_PERCPU(name) \
+ DEFINE_PER_CPU(struct torture_random_state, name)
unsigned long torture_random(struct torture_random_state *trsp);
/* Task shuffler, which causes CPUs to occasionally go idle. */