Merge remote branch 'linus/master'
[powerpc.git] / kernel / rcutorture.c
index ddff332..fd59982 100644 (file)
 #include <linux/sched.h>
 #include <asm/atomic.h>
 #include <linux/bitops.h>
-#include <linux/module.h>
 #include <linux/completion.h>
 #include <linux/moduleparam.h>
 #include <linux/percpu.h>
 #include <linux/notifier.h>
 #include <linux/freezer.h>
 #include <linux/cpu.h>
-#include <linux/random.h>
 #include <linux/delay.h>
 #include <linux/byteorder/swabb.h>
 #include <linux/stat.h>
@@ -166,16 +164,14 @@ struct rcu_random_state {
 
 /*
  * Crude but fast random-number generator.  Uses a linear congruential
- * generator, with occasional help from get_random_bytes().
+ * generator, with occasional help from cpu_clock().
  */
 static unsigned long
 rcu_random(struct rcu_random_state *rrsp)
 {
-       long refresh;
-
        if (--rrsp->rrs_count < 0) {
-               get_random_bytes(&refresh, sizeof(refresh));
-               rrsp->rrs_state += refresh;
+               rrsp->rrs_state +=
+                       (unsigned long)cpu_clock(raw_smp_processor_id());
                rrsp->rrs_count = RCU_RANDOM_REFRESH;
        }
        rrsp->rrs_state = rrsp->rrs_state * RCU_RANDOM_MULT + RCU_RANDOM_ADD;
@@ -730,11 +726,11 @@ static void rcu_torture_shuffle_tasks(void)
        cpumask_t tmp_mask = CPU_MASK_ALL;
        int i;
 
-       lock_cpu_hotplug();
+       get_online_cpus();
 
        /* No point in shuffling if there is only one online CPU (ex: UP) */
        if (num_online_cpus() == 1) {
-               unlock_cpu_hotplug();
+               put_online_cpus();
                return;
        }
 
@@ -766,7 +762,7 @@ static void rcu_torture_shuffle_tasks(void)
        else
                rcu_idle_cpu--;
 
-       unlock_cpu_hotplug();
+       put_online_cpus();
 }
 
 /* Shuffle tasks across CPUs, with the intent of allowing each CPU in the