aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/rcupdate.c4
-rw-r--r--lib/Kconfig.debug14
2 files changed, 18 insertions, 0 deletions
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
index 4e6a61b15e86..29ca1c6da594 100644
--- a/kernel/rcupdate.c
+++ b/kernel/rcupdate.c
@@ -45,6 +45,7 @@
45#include <linux/mutex.h> 45#include <linux/mutex.h>
46#include <linux/export.h> 46#include <linux/export.h>
47#include <linux/hardirq.h> 47#include <linux/hardirq.h>
48#include <linux/delay.h>
48 49
49#define CREATE_TRACE_POINTS 50#define CREATE_TRACE_POINTS
50#include <trace/events/rcu.h> 51#include <trace/events/rcu.h>
@@ -81,6 +82,9 @@ void __rcu_read_unlock(void)
81 } else { 82 } else {
82 barrier(); /* critical section before exit code. */ 83 barrier(); /* critical section before exit code. */
83 t->rcu_read_lock_nesting = INT_MIN; 84 t->rcu_read_lock_nesting = INT_MIN;
85#ifdef CONFIG_PROVE_RCU_DELAY
86 udelay(10); /* Make preemption more probable. */
87#endif /* #ifdef CONFIG_PROVE_RCU_DELAY */
84 barrier(); /* assign before ->rcu_read_unlock_special load */ 88 barrier(); /* assign before ->rcu_read_unlock_special load */
85 if (unlikely(ACCESS_ONCE(t->rcu_read_unlock_special))) 89 if (unlikely(ACCESS_ONCE(t->rcu_read_unlock_special)))
86 rcu_read_unlock_special(t); 90 rcu_read_unlock_special(t);
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 2403a63b5da5..dacbbe4d7a80 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -629,6 +629,20 @@ config PROVE_RCU_REPEATEDLY
629 629
630 Say N if you are unsure. 630 Say N if you are unsure.
631 631
632config PROVE_RCU_DELAY
633 bool "RCU debugging: preemptible RCU race provocation"
634 depends on DEBUG_KERNEL && PREEMPT_RCU
635 default n
636 help
637 There is a class of races that involve an unlikely preemption
638 of __rcu_read_unlock() just after ->rcu_read_lock_nesting has
639 been set to INT_MIN. This feature inserts a delay at that
640 point to increase the probability of these races.
641
642 Say Y to increase probability of preemption of __rcu_read_unlock().
643
644 Say N if you are unsure.
645
632config SPARSE_RCU_POINTER 646config SPARSE_RCU_POINTER
633 bool "RCU debugging: sparse-based checks for pointer usage" 647 bool "RCU debugging: sparse-based checks for pointer usage"
634 default n 648 default n