alistair23-linux/kernel/rcu
Paul E. McKenney d19fb8d1f3 rcu: Don't migrate blocked tasks even if all corresponding CPUs offline
When the last CPU associated with a given leaf rcu_node structure
goes offline, something must be done about the tasks queued on that
rcu_node structure.  Each of these tasks has been preempted on one of
the leaf rcu_node structure's CPUs while in an RCU read-side critical
section that it have not yet exited.  Handling these tasks is the job of
rcu_preempt_offline_tasks(), which migrates them from the leaf rcu_node
structure to the root rcu_node structure.

Unfortunately, this migration has to be done one task at a time because
each tasks allegiance must be shifted from the original leaf rcu_node to
the root, so that future attempts to deal with these tasks will acquire
the root rcu_node structure's ->lock rather than that of the leaf.
Worse yet, this migration must be done with interrupts disabled, which
is not so good for realtime response, especially given that there is
no bound on the number of tasks on a given rcu_node structure's list.
(OK, OK, there is a bound, it is just that it is unreasonably large,
especially on 64-bit systems.)  This was not considered a problem back
when rcu_preempt_offline_tasks() was first written because realtime
systems were assumed not to do CPU-hotplug operations while real-time
applications were running.  This assumption has proved of dubious validity
given that people are starting to run multiple realtime applications
on a single SMP system and that it is common practice to offline then
online a CPU before starting its real-time application in order to clear
extraneous processing off of that CPU.  So we now need CPU hotplug
operations to avoid undue latencies.

This commit therefore avoids migrating these tasks, instead letting
them be dequeued one by one from the original leaf rcu_node structure
by rcu_read_unlock_special().  This means that the clearing of bits
from the upper-level rcu_node structures must be deferred until the
last such task has been dequeued, because otherwise subsequent grace
periods won't wait on them.  This commit has the beneficial side effect
of simplifying the CPU-hotplug code for TREE_PREEMPT_RCU, especially in
CONFIG_RCU_BOOST builds.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2015-01-06 11:02:44 -08:00
..
Makefile rcu: Remove redundant TREE_PREEMPT_RCU config option 2014-10-29 10:20:05 -07:00
rcu.h rcutorture: Add early boot self tests 2014-11-03 19:26:37 -08:00
rcutorture.c rcutorture: Fix rcu_torture_cbflood() memory leak 2014-11-03 19:26:41 -08:00
srcu.c rcu: Eliminate read-modify-write ACCESS_ONCE() calls 2014-07-09 09:14:49 -07:00
tiny.c Merge branches 'torture.2014.11.03a', 'cpu.2014.11.03a', 'doc.2014.11.13a', 'fixes.2014.11.13a', 'signal.2014.10.29a' and 'rt.2014.10.29a' into HEAD 2014-11-13 10:39:04 -08:00
tiny_plugin.h rcu: Protect uses of ->jiffies_stall with ACCESS_ONCE() 2014-04-29 08:44:41 -07:00
tree.c rcu: Don't migrate blocked tasks even if all corresponding CPUs offline 2015-01-06 11:02:44 -08:00
tree.h rcu: Don't migrate blocked tasks even if all corresponding CPUs offline 2015-01-06 11:02:44 -08:00
tree_plugin.h rcu: Don't migrate blocked tasks even if all corresponding CPUs offline 2015-01-06 11:02:44 -08:00
tree_trace.c rcu: Stop tracking FSF's postal address 2014-02-17 15:01:37 -08:00
update.c Merge branches 'torture.2014.11.03a', 'cpu.2014.11.03a', 'doc.2014.11.13a', 'fixes.2014.11.13a', 'signal.2014.10.29a' and 'rt.2014.10.29a' into HEAD 2014-11-13 10:39:04 -08:00