Skip to content

Commit 07b4a93

Browse files
Lai Jiangshanpaulmckrcu
authored andcommitted
rcu: Don't set nesting depth negative in rcu_preempt_deferred_qs()
Now that RCU flavors have been consolidated, an RCU-preempt rcu_read_unlock() in an interrupt or softirq handler cannot possibly end the RCU read-side critical section. Consider the old vulnerability involving rcu_preempt_deferred_qs() being invoked within such a handler that interrupted an extended RCU read-side critical section, in which a wakeup might be invoked with a scheduler lock held. Because rcu_read_unlock_special() no longer does wakeups in such situations, it is no longer necessary for rcu_preempt_deferred_qs() to set the nesting level negative. This commit therefore removes this recursion-protection code from rcu_preempt_deferred_qs(). [ paulmck: Fix typo in commit log per Steve Rostedt. ] Signed-off-by: Lai Jiangshan <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent e4453d8 commit 07b4a93

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

kernel/rcu/tree_plugin.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -569,16 +569,11 @@ static bool rcu_preempt_need_deferred_qs(struct task_struct *t)
569569
static void rcu_preempt_deferred_qs(struct task_struct *t)
570570
{
571571
unsigned long flags;
572-
bool couldrecurse = rcu_preempt_depth() >= 0;
573572

574573
if (!rcu_preempt_need_deferred_qs(t))
575574
return;
576-
if (couldrecurse)
577-
rcu_preempt_depth_set(rcu_preempt_depth() - RCU_NEST_BIAS);
578575
local_irq_save(flags);
579576
rcu_preempt_deferred_qs_irqrestore(t, flags);
580-
if (couldrecurse)
581-
rcu_preempt_depth_set(rcu_preempt_depth() + RCU_NEST_BIAS);
582577
}
583578

584579
/*

0 commit comments

Comments
 (0)