summaryrefslogtreecommitdiff
path: root/kernel/rcutree.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2011-10-05 18:45:18 (GMT)
committerScott Wood <scottwood@freescale.com>2015-02-13 22:20:48 (GMT)
commit43cb6da556a78eca0b13cf49492d68e6d03e5dbf (patch)
treefd0099f33e456f758141b24e96b8ccfb35e5ea32 /kernel/rcutree.c
parente8656db9c868496f3cbea644b826b62b3947ef74 (diff)
downloadlinux-fsl-qoriq-43cb6da556a78eca0b13cf49492d68e6d03e5dbf.tar.xz
rcu: Make ksoftirqd do RCU quiescent states
Implementing RCU-bh in terms of RCU-preempt makes the system vulnerable to network-based denial-of-service attacks. This patch therefore makes __do_softirq() invoke rcu_bh_qs(), but only when __do_softirq() is running in ksoftirqd context. A wrapper layer in interposed so that other calls to __do_softirq() avoid invoking rcu_bh_qs(). The underlying function __do_softirq_common() does the actual work. The reason that rcu_bh_qs() is bad in these non-ksoftirqd contexts is that there might be a local_bh_enable() inside an RCU-preempt read-side critical section. This local_bh_enable() can invoke __do_softirq() directly, so if __do_softirq() were to invoke rcu_bh_qs() (which just calls rcu_preempt_qs() in the PREEMPT_RT_FULL case), there would be an illegal RCU-preempt quiescent state in the middle of an RCU-preempt read-side critical section. Therefore, quiescent states can only happen in cases where __do_softirq() is invoked directly from ksoftirqd. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/20111005184518.GA21601@linux.vnet.ibm.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r--kernel/rcutree.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 5521a4b..a6b31e5 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -199,7 +199,14 @@ void rcu_sched_qs(int cpu)
rdp->passed_quiesce = 1;
}
-#ifndef CONFIG_PREEMPT_RT_FULL
+#ifdef CONFIG_PREEMPT_RT_FULL
+static void rcu_preempt_qs(int cpu);
+
+void rcu_bh_qs(int cpu)
+{
+ rcu_preempt_qs(cpu);
+}
+#else
void rcu_bh_qs(int cpu)
{
struct rcu_data *rdp = &per_cpu(rcu_bh_data, cpu);