diff options
Diffstat (limited to 'kernel/rcu/tree.c')
| -rw-r--r-- | kernel/rcu/tree.c | 28 | 
1 files changed, 20 insertions, 8 deletions
| diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 1250e4bd4b85..3e3650e94ae6 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -882,6 +882,11 @@ void rcu_irq_exit(void)  	RCU_LOCKDEP_WARN(!irqs_disabled(), "rcu_irq_exit() invoked with irqs enabled!!!");  	rdtp = this_cpu_ptr(&rcu_dynticks); + +	/* Page faults can happen in NMI handlers, so check... */ +	if (rdtp->dynticks_nmi_nesting) +		return; +  	WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&  		     rdtp->dynticks_nesting < 1);  	if (rdtp->dynticks_nesting <= 1) { @@ -1015,6 +1020,11 @@ void rcu_irq_enter(void)  	RCU_LOCKDEP_WARN(!irqs_disabled(), "rcu_irq_enter() invoked with irqs enabled!!!");  	rdtp = this_cpu_ptr(&rcu_dynticks); + +	/* Page faults can happen in NMI handlers, so check... */ +	if (rdtp->dynticks_nmi_nesting) +		return; +  	oldval = rdtp->dynticks_nesting;  	rdtp->dynticks_nesting++;  	WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && @@ -3087,9 +3097,10 @@ __call_rcu(struct rcu_head *head, rcu_callback_t func,   * read-side critical sections have completed. call_rcu_sched() assumes   * that the read-side critical sections end on enabling of preemption   * or on voluntary preemption. - * RCU read-side critical sections are delimited by : - *  - rcu_read_lock_sched() and rcu_read_unlock_sched(), OR - *  - anything that disables preemption. + * RCU read-side critical sections are delimited by: + * + * - rcu_read_lock_sched() and rcu_read_unlock_sched(), OR + * - anything that disables preemption.   *   *  These may be nested.   * @@ -3114,11 +3125,12 @@ EXPORT_SYMBOL_GPL(call_rcu_sched);   * handler. This means that read-side critical sections in process   * context must not be interrupted by softirqs. This interface is to be   * used when most of the read-side critical sections are in softirq context. - * RCU read-side critical sections are delimited by : - *  - rcu_read_lock() and  rcu_read_unlock(), if in interrupt context. - *  OR - *  - rcu_read_lock_bh() and rcu_read_unlock_bh(), if in process context. - *  These may be nested. + * RCU read-side critical sections are delimited by: + * + * - rcu_read_lock() and  rcu_read_unlock(), if in interrupt context, OR + * - rcu_read_lock_bh() and rcu_read_unlock_bh(), if in process context. + * + * These may be nested.   *   * See the description of call_rcu() for more detailed information on   * memory ordering guarantees. |