rcu: Make ksoftirqd do RCU quiescent states
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 5 Oct 2011 18:45:18 +0000 (11:45 -0700)
committerClark Williams <williams@redhat.com>
Wed, 15 Feb 2012 16:32:55 +0000 (10:32 -0600)
commitc75020854370faa8890b0ae11e34e82c19cc51e7
treebc042e1c389daf5b072c2e2ec3bbdca4246fb4ce
parent37d6cc835aed4c5db0eae2b65b3cdf9d76ea86fd
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>
include/linux/rcupdate.h
kernel/rcutree.c
kernel/rcutree.h
kernel/rcutree_plugin.h
kernel/softirq.c