X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=kernel%2Frcutorture.c;h=fd599829e72a5d49a5852272ba234be8c38accaf;hb=4077960e2a38ec59096ff993cd080056e17f3707;hp=ddff33247785aa95a95f00356f9909dde2ff3196;hpb=831441862956fffa17b9801db37e6ea1650b0f69;p=linux-2.6-omap-h63xx.git diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c index ddff3324778..fd599829e72 100644 --- a/kernel/rcutorture.c +++ b/kernel/rcutorture.c @@ -35,14 +35,12 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include #include #include @@ -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