+ allow-rcutorture-to-handle-synchronize_sched.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Allow rcutorture to handle synchronize_sched()
has been added to the -mm tree.  Its filename is
     allow-rcutorture-to-handle-synchronize_sched.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: Allow rcutorture to handle synchronize_sched()
From: "Paul E. McKenney" <paulmck@xxxxxxxxxxxxxxxxxx>

The rcutorture module uses a random-number generator that periodically
calls get_random_bytes() to add entropy.  This random-number generator is
invoked from within the RCU read-side critical section, which, in the case
of the synchronize_sched() variant of RCU, has preeemption disabled. 
Unfortunately, get_random_bytes() ends up acquiring normal spinlocks, which
can block in -rt, resulting in very large numbers of "scheduling while
atomic" messages.

This patch takes a very crude approach, simply substituting the time
of day for get_random_bytes().

Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
Acked-by: Josh Triplett <josh@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 kernel/rcutorture.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff -puN kernel/rcutorture.c~allow-rcutorture-to-handle-synchronize_sched kernel/rcutorture.c
--- a/kernel/rcutorture.c~allow-rcutorture-to-handle-synchronize_sched
+++ a/kernel/rcutorture.c
@@ -165,16 +165,13 @@ 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 the time-of-day 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 += xtime.tv_nsec;
 		rrsp->rrs_count = RCU_RANDOM_REFRESH;
 	}
 	rrsp->rrs_state = rrsp->rrs_state * RCU_RANDOM_MULT + RCU_RANDOM_ADD;
_

Patches currently in -mm which might be from paulmck@xxxxxxxxxxxxxxxxxx are

allow-rcutorture-to-handle-synchronize_sched.patch
fib_trie-cleanup-fix.patch
immunize-rcu_dereference-against-crazy-compiler-writers.patch
remove-workaround-for-unimmunized-rcu_dereference-from-mce_log.patch
clean-up-duplicate-includes-in-kernel.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux