History

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 <laijs@linux.alibaba.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

Lai Jiangshan committed 6 years ago

Commit 07b4a931 parent e4453d81 file · +0 −5Browse files

Unified · Split

kernel/rcu/tree_plugin.h+0−5
@@ -569,16 +569,11 @@ static bool rcu_preempt_need_deferred_qs(struct task_struct *t) · 568 unmodified lines
569static void rcu_preempt_deferred_qs(struct task_struct *t)569static void rcu_preempt_deferred_qs(struct task_struct *t)
570{570{
571 unsigned long flags;571 unsigned long flags;
572 bool couldrecurse = rcu_preempt_depth() >= 0;
573 572
574 if (!rcu_preempt_need_deferred_qs(t))573 if (!rcu_preempt_need_deferred_qs(t))
575 return;574 return;
576 if (couldrecurse)
577 rcu_preempt_depth_set(rcu_preempt_depth() - RCU_NEST_BIAS);
578 local_irq_save(flags);575 local_irq_save(flags);
579 rcu_preempt_deferred_qs_irqrestore(t, flags);576 rcu_preempt_deferred_qs_irqrestore(t, flags);
580 if (couldrecurse)
581 rcu_preempt_depth_set(rcu_preempt_depth() + RCU_NEST_BIAS);
582}577}
583 578
584/*579/*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t