summaryrefslogtreecommitdiff
path: root/include/linux/torture.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2018-05-22 21:38:47 +0300
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2018-07-13 01:42:04 +0300
commit3025520ec424df8b0fd5cdc319ad6b83406d9954 (patch)
treec58744959ebe2755b9c5dcb6b78049eaa6f866f1 /include/linux/torture.h
parent8da9a59523b6608f4b21f3e489578d0993c0779f (diff)
downloadlinux-3025520ec424df8b0fd5cdc319ad6b83406d9954.tar.xz
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. */