Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rcu: Remove local_irq_save/restore() in rcu_preempt_deferred_qs_handler()

The per-CPU rcu_data structure's ->defer_qs_iw field is initialized
by IRQ_WORK_INIT_HARD(), which means that the subsequent invocation of
rcu_preempt_deferred_qs_handler() will always be executed with interrupts
disabled. This commit therefore removes the local_irq_save/restore()
operations from rcu_preempt_deferred_qs_handler() and adds a call to
lockdep_assert_irqs_disabled() in order to enable lockdep to diagnose
mistaken invocations of this function from interrupts-enabled code.

Signed-off-by: Zqiang <qiang.zhang@linux.dev>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

authored by

Zqiang and committed by
Paul E. McKenney
42d590d1 faab3ae3

+1 -4
+1 -4
kernel/rcu/tree_plugin.h
··· 626 626 */ 627 627 static void rcu_preempt_deferred_qs_handler(struct irq_work *iwp) 628 628 { 629 - unsigned long flags; 630 629 struct rcu_data *rdp; 631 630 631 + lockdep_assert_irqs_disabled(); 632 632 rdp = container_of(iwp, struct rcu_data, defer_qs_iw); 633 - local_irq_save(flags); 634 633 635 634 /* 636 635 * If the IRQ work handler happens to run in the middle of RCU read-side ··· 646 647 */ 647 648 if (rcu_preempt_depth() > 0) 648 649 WRITE_ONCE(rdp->defer_qs_iw_pending, DEFER_QS_IDLE); 649 - 650 - local_irq_restore(flags); 651 650 } 652 651 653 652 /*