All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	netfilter-devel@vger.kernel.org
Cc: mingo@elte.hu, akpm@linux-foundation.org,
	torvalds@linux-foundation.org, davem@davemloft.net,
	dada1@cosmosbay.com, zbr@ioremap.net, jeff.chua.linux@gmail.com,
	paulus@samba.org, laijs@cn.fujitsu.com, jengelh@medozas.de,
	r000n@r000n.net, benh@kernel.crashing.org,
	mathieu.desnoyers@polymtl.ca
Subject: [PATCH -tip 0/3] expedited "big hammer" RCU grace periods
Date: Thu, 25 Jun 2009 09:07:06 -0700	[thread overview]
Message-ID: <20090625160706.GA9467@linux.vnet.ibm.com> (raw)

Respin of http://lkml.org/lkml/2009/6/24/350 to allow for the removal
of Classic RCU (in favor of Hierarchical RCU) from the -tip tree.

This patch set implements the "big hammer" expedited RCU grace periods.
This leverages the existing per-CPU migration kthreads, as suggested
by Ingo.  These are awakened in a loop, and waited for in a second loop.
Not fully scalable, but removing the extra hop through smp_call_function
reduces latency on systems with moderate numbers of CPUs.  The
synchronize_rcu_expedited() and synchronize_bh_expedited() primitives
invoke synchronize_sched_expedited(), except for CONFIG_PREEMPT_RCU,
where they instead invoke synchronize_rcu() and synchronize_rcu_bh(),
respectively.  This will be fixed in the future, after preemptable RCU
is folded into the rcutree implementation.

As before, this does nothing to expedite callbacks already registered
with call_rcu() or call_rcu_bh(), but there is no need to.

Passes many hours of rcutorture testing in parallel with a script
that randomly offlines and onlines CPUs in a number of configurations.
Grace periods take about 40 microseconds on an 8-CPU Power machine, which
I believe is good enough from a performance viewpoint for the near future.
This represents some slowdown from v7, which was unfortunately necessary
to fix some bugs.

This is finally ready for inclusion.  ;-)

Shortcomings:

o	Does not address preemptable RCU (though synchronize_sched_expedited()
	is in fact expedited in this configuration).

o	Probably not helpful on systems with thousands of CPUs, but likely
	quite helpful even on systems with a few hundred CPUs.

Changes since v7:

o	Fixed several embarrassing bugs turned up by tests on multiple
	configurations.

Changes since v6:

o	Moved to using the migration threads, as suggested by Ingo.

Changes since v5:

o	Fixed several embarrassing locking bugs, including those
	noted by Ingo and Lai.

o	Added a missing set of braces.

o	Cut out the extra kthread, so that synchronize_sched_expedited()
	directly calls smp_call_function() and waits for the quiescent
	states.

o	Removed some debug code, but promoted one to production.

o	Fix a compiler warning.

Changes since v4:

o	Use per-CPU kthreads to force the quiescent states in parallel.

Changes since v3:

o	Use a kthread that schedules itself on each CPU in turn to
	force a grace period.  The synchronize_rcu() primitive
	wakes up the kthread in order to avoid messing with affinity
	masks on user tasks.

o	Tried a number of additional variations on the v3 approach, none
	of which helped much.

Changes since v2:

o	Use reschedule IPIs rather than a softirq.

Changes since v1:

o	Added rcutorture support, and added exports required by
	rcutorture.

o	Added comment stating that smp_call_function() implies a
	memory barrier, suggested by Mathieu.

o	Added #include for delay.h.

 Documentation/RCU/RTFP.txt       |   77 ++++++++++++++
 Documentation/RCU/UP.txt         |   34 ++++--
 Documentation/RCU/checklist.txt  |   20 ++-
 Documentation/RCU/rcubarrier.txt |    7 +
 Documentation/RCU/torture.txt    |   23 ++++
 Documentation/RCU/whatisRCU.txt  |   15 ++
 include/linux/rcupdate.h         |   25 ++--
 include/linux/rcupreempt.h       |   10 +
 include/linux/rcutree.h          |   12 ++
 kernel/rcupdate.c                |   25 ++++
 kernel/rcutorture.c              |  203 +++++++++++++++++++++------------------
 kernel/sched.c                   |  130 ++++++++++++++++++++++++
 12 files changed, 452 insertions(+), 129 deletions(-)

             reply	other threads:[~2009-06-25 16:07 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-25 16:07 Paul E. McKenney [this message]
2009-06-25 16:08 ` [PATCH -tip 1/3] synchronize_sched_expedited() primitive Paul E. McKenney
2009-06-25 16:08 ` Paul E. McKenney
2009-06-25 16:08 ` Paul E. McKenney
2009-07-03  8:57   ` [tip:core/rcu] rcu: Add " tip-bot for Paul E. McKenney
2009-06-25 16:08 ` [PATCH -tip 1/3] " Paul E. McKenney
2009-06-25 16:08 ` [PATCH -tip 2/3] synchronize_sched_expedited() torture tests Paul E. McKenney
2009-06-25 16:08 ` Paul E. McKenney
2009-06-25 16:08 ` Paul E. McKenney
2009-07-03  8:58   ` [tip:core/rcu] rcu: Add " tip-bot for Paul E. McKenney
2009-06-25 16:08 ` [PATCH -tip 2/3] " Paul E. McKenney
2009-06-25 16:08 ` [PATCH -tip 3/3] synchronize_sched_expedited() rcutorture doc + updates Paul E. McKenney
2009-06-25 16:08 ` Paul E. McKenney
2009-06-25 16:08 ` Paul E. McKenney
2009-06-25 16:08 ` Paul E. McKenney
2009-07-03  8:58   ` [tip:core/rcu] rcu: Add " tip-bot for Paul E. McKenney
  -- strict thread matches above, loose matches on Subject: below --
2009-06-24 16:45 [PATCH -tip 0/3] expedited "big hammer" RCU grace periods Paul E. McKenney
2009-06-24 18:03 ` Ingo Molnar
2009-06-24 18:44   ` Paul E. McKenney
2009-06-25  9:59     ` Ingo Molnar
2009-06-25 15:27       ` Paul E. McKenney
2009-06-25 16:47       ` Linus Torvalds
2009-06-25 17:54         ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090625160706.GA9467@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=dada1@cosmosbay.com \
    --cc=davem@davemloft.net \
    --cc=jeff.chua.linux@gmail.com \
    --cc=jengelh@medozas.de \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=mingo@elte.hu \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=r000n@r000n.net \
    --cc=torvalds@linux-foundation.org \
    --cc=zbr@ioremap.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.