"Paul E. McKenney" <paul...@kernel.org> writes:

> On Tue, May 05, 2020 at 03:44:05PM +0200, Thomas Gleixner wrote:
>> Interrupts and exceptions invoke rcu_irq_enter() on entry and need to
>> invoke rcu_irq_exit() before they either return to the interrupted code or
>> invoke the scheduler due to preemption.
>> 
>> The general assumption is that RCU idle code has to have preemption
>> disabled so that a return from interrupt cannot schedule. So the return
>> from interrupt code invokes rcu_irq_exit() and preempt_schedule_irq().
>> 
>> If there is any imbalance in the rcu_irq/nmi* invocations or RCU idle code
>> had preemption enabled then this goes unnoticed until the CPU goes idle or
>> some other RCU check is executed.
>> 
>> Provide rcu_irq_exit_preempt() which can be invoked from the
>> interrupt/exception return code in case that preemption is enabled. It
>> invokes rcu_irq_exit() and contains a few sanity checks in case that
>> CONFIG_PROVE_RCU is enabled to catch such issues directly.
>> 
>> Signed-off-by: Thomas Gleixner <t...@linutronix.de>
>> Cc: "Paul E. McKenney" <paul...@kernel.org>
>> Cc: Joel Fernandes <j...@joelfernandes.org>
>
> The ->dynticks_nmi_nesting field is going away at some point, but
> there is always "git merge".  ;-)

Yes. The logistics for merging all of this is going to be interesting :)

Reply via email to