aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/rcutorture.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
index dd413bf6a1d2..c3e165c2318f 100644
--- a/kernel/rcutorture.c
+++ b/kernel/rcutorture.c
@@ -41,7 +41,6 @@
41#include <linux/notifier.h> 41#include <linux/notifier.h>
42#include <linux/freezer.h> 42#include <linux/freezer.h>
43#include <linux/cpu.h> 43#include <linux/cpu.h>
44#include <linux/random.h>
45#include <linux/delay.h> 44#include <linux/delay.h>
46#include <linux/byteorder/swabb.h> 45#include <linux/byteorder/swabb.h>
47#include <linux/stat.h> 46#include <linux/stat.h>
@@ -165,16 +164,14 @@ struct rcu_random_state {
165 164
166/* 165/*
167 * Crude but fast random-number generator. Uses a linear congruential 166 * Crude but fast random-number generator. Uses a linear congruential
168 * generator, with occasional help from get_random_bytes(). 167 * generator, with occasional help from cpu_clock().
169 */ 168 */
170static unsigned long 169static unsigned long
171rcu_random(struct rcu_random_state *rrsp) 170rcu_random(struct rcu_random_state *rrsp)
172{ 171{
173 long refresh;
174
175 if (--rrsp->rrs_count < 0) { 172 if (--rrsp->rrs_count < 0) {
176 get_random_bytes(&refresh, sizeof(refresh)); 173 rrsp->rrs_state +=
177 rrsp->rrs_state += refresh; 174 (unsigned long)cpu_clock(raw_smp_processor_id());
178 rrsp->rrs_count = RCU_RANDOM_REFRESH; 175 rrsp->rrs_count = RCU_RANDOM_REFRESH;
179 } 176 }
180 rrsp->rrs_state = rrsp->rrs_state * RCU_RANDOM_MULT + RCU_RANDOM_ADD; 177 rrsp->rrs_state = rrsp->rrs_state * RCU_RANDOM_MULT + RCU_RANDOM_ADD;