Skip to content

Commit 42d590d

Browse files
Zqiangpaulmckrcu
authored andcommitted
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>
1 parent faab3ae commit 42d590d

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

kernel/rcu/tree_plugin.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -626,11 +626,10 @@ notrace void rcu_preempt_deferred_qs(struct task_struct *t)
626626
*/
627627
static void rcu_preempt_deferred_qs_handler(struct irq_work *iwp)
628628
{
629-
unsigned long flags;
630629
struct rcu_data *rdp;
631630

631+
lockdep_assert_irqs_disabled();
632632
rdp = container_of(iwp, struct rcu_data, defer_qs_iw);
633-
local_irq_save(flags);
634633

635634
/*
636635
* If the IRQ work handler happens to run in the middle of RCU read-side
@@ -647,8 +646,6 @@ static void rcu_preempt_deferred_qs_handler(struct irq_work *iwp)
647646
*/
648647
if (rcu_preempt_depth() > 0)
649648
WRITE_ONCE(rdp->defer_qs_iw_pending, DEFER_QS_IDLE);
650-
651-
local_irq_restore(flags);
652649
}
653650

654651
/*

0 commit comments

Comments
 (0)