2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-16 01:04:08 +08:00
linux-next/Documentation/RCU
Tejun Heo 969c79215a sched: replace migration_thread with cpu_stop
Currently migration_thread is serving three purposes - migration
pusher, context to execute active_load_balance() and forced context
switcher for expedited RCU synchronize_sched.  All three roles are
hardcoded into migration_thread() and determining which job is
scheduled is slightly messy.

This patch kills migration_thread and replaces all three uses with
cpu_stop.  The three different roles of migration_thread() are
splitted into three separate cpu_stop callbacks -
migration_cpu_stop(), active_load_balance_cpu_stop() and
synchronize_sched_expedited_cpu_stop() - and each use case now simply
asks cpu_stop to execute the callback as necessary.

synchronize_sched_expedited() was implemented with private
preallocated resources and custom multi-cpu queueing and waiting
logic, both of which are provided by cpu_stop.
synchronize_sched_expedited_count is made atomic and all other shared
resources along with the mutex are dropped.

synchronize_sched_expedited() also implemented a check to detect cases
where not all the callback got executed on their assigned cpus and
fall back to synchronize_sched().  If called with cpu hotplug blocked,
cpu_stop already guarantees that and the condition cannot happen;
otherwise, stop_machine() would break.  However, this patch preserves
the paranoid check using a cpumask to record on which cpus the stopper
ran so that it can serve as a bisection point if something actually
goes wrong theree.

Because the internal execution state is no longer visible,
rcu_expedited_torture_stats() is removed.

This patch also renames cpu_stop threads to from "stopper/%d" to
"migration/%d".  The names of these threads ultimately don't matter
and there's no reason to make unnecessary userland visible changes.

With this patch applied, stop_machine() and sched now share the same
resources.  stop_machine() is faster without wasting any resources and
sched migration users are much cleaner.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Dipankar Sarma <dipankar@in.ibm.com>
Cc: Josh Triplett <josh@freedesktop.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Dimitri Sivanich <sivanich@sgi.com>
2010-05-06 18:49:21 +02:00
..
00-INDEX rcu: Documentation update for CONFIG_PROVE_RCU 2010-02-25 10:34:53 +01:00
arrayRCU.txt Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
checklist.txt rcu: Documentation update for CONFIG_PROVE_RCU 2010-02-25 10:34:53 +01:00
listRCU.txt Doc: Fix wrong API example usage of call_rcu(). 2009-04-02 01:33:50 -07:00
lockdep.txt rcu: Documentation update for CONFIG_PROVE_RCU 2010-02-25 10:34:53 +01:00
NMI-RCU.txt sched: 1Q08 RCU doc update, add call_rcu_sched() 2008-05-19 10:01:37 +02:00
rcu.txt rcu: 1Q2010 update for RCU documentation 2010-01-16 10:25:22 +01:00
rcubarrier.txt rcu: Add synchronize_sched_expedited() rcutorture doc + updates 2009-07-03 10:02:29 +02:00
rculist_nulls.txt netfilter: nf_conntrack: nf_conntrack_alloc() fixes 2009-07-16 14:03:40 +02:00
rcuref.txt doc/RCU: fix pseudocode in rcuref.txt 2008-09-10 08:36:07 +02:00
RTFP.txt rcu: Use canonical URL for Mathieu's dissertation 2010-02-25 10:34:56 +01:00
stallwarn.txt rcu: 1Q2010 update for RCU documentation 2010-01-16 10:25:22 +01:00
torture.txt sched: replace migration_thread with cpu_stop 2010-05-06 18:49:21 +02:00
trace.txt rcu: Update trace.txt documentation for blocked-tasks lists 2009-10-15 11:20:23 +02:00
UP.txt rcu: Add synchronize_sched_expedited() rcutorture doc + updates 2009-07-03 10:02:29 +02:00
whatisRCU.txt rcu: Documentation update for CONFIG_PROVE_RCU 2010-02-25 10:34:53 +01:00