All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	josh@joshtriplett.org, linux-kernel@vger.kernel.org,
	laijs@cn.fujitsu.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
	tglx@linutronix.de, rostedt@goodmis.org, dhowells@redhat.com,
	edumazet@google.com, dvhart@linux.intel.com, fweisbec@gmail.com,
	oleg@redhat.com, bobby.prani@gmail.com
Subject: Re: [PATCH RFC tip/core/rcu 0/5] Expedited grace periods encouraging normal ones
Date: Thu, 2 Jul 2015 12:22:00 -0700	[thread overview]
Message-ID: <20150702192200.GO3717@linux.vnet.ibm.com> (raw)
In-Reply-To: <20150702183557.GA15331@gmail.com>

On Thu, Jul 02, 2015 at 08:35:57PM +0200, Ingo Molnar wrote:
> 
> * Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:
> 
> > > And it's not like it's that hard to stem the flow of algorithmic sloppiness at 
> > > the source, right?
> > 
> > OK, first let me make sure that I understand what you are asking for:
> > 
> > 1.	Completely eliminate synchronize_rcu_expedited() and
> > 	synchronize_sched_expedited(), replacing all uses with their
> > 	unexpedited counterparts.  (Note that synchronize_srcu_expedited()
> > 	does not wake up CPUs, courtesy of its read-side memory barriers.)
> > 	The fast-boot guys are probably going to complain, along with
> > 	the networking guys.
> > 
> > 2.	Keep synchronize_rcu_expedited() and synchronize_sched_expedited(),
> > 	but push back hard on any new uses and question any existing uses.
> > 
> > 3.	Revert 74b51ee152b6 ("ACPI / osl: speedup grace period in
> > 	acpi_os_map_cleanup").
> > 
> > 4.	Something else?
> 
> I'd love to have 1) but 2) would be a realistic second best option? ;-)

OK, how about the following checkpatch.pl patch?

And here are some other actions I have taken and will take to improve
the situation, both for OS jitter and for scalability:

o	Reduce OS jitter by switching from try_stop_cpus() to
	stop_one_cpu_nowait(), courtesy of Peter Zijlstra.

	I expect to send this in v4.3 or v4.4, depending on how
	testing and review goes.

o	Eliminate expedited-grace-period-induced OS jitter on idle CPUs.
	This went into v3.19.  Note that this also avoids IPIing
	nohz_full CPUs.

o	I believe that I can reduce OS jitter by a further factor of two
	(worst case) or factor of five (average case), but I am still
	thinking about exactly how to do this.	(This also has the
	benefit of shutting up a lockdep false positive.)

o	There is a global counter that synchronize_sched_expedited()
	uses to determine when all the CPUs have passed through a
	quiescent state.  This is a scalability bottleneck on modest
	systems under heavy load, so I will be switching this to
	instead use the combining tree.

o	Because both synchronize_sched_expedited() and
	synchronize_rcu_expedited() can potentially wake up each and
	every CPU, on sufficiently large systems, they are quite slow.
	If this scalability problem ever becomes real, I intend to use
	multiple kthreads to do the wakeups on large systems.

Seem reasonable?

							Thanx, Paul

------------------------------------------------------------------------

scripts: Make checkpatch.pl warn on expedited RCU grace periods

The synchronize_rcu_expedited() and synchronize_sched_expedited()
expedited-grace-period primitives induce OS jitter, which can degrade
real-time response.  This commit therefore adds a checkpatch.pl warning
on any patch adding them.

Note that this patch does not warn on synchronize_srcu_expedited()
because it does not induce OS jitter, courtesy of its otherwise
much-maligned read-side memory barriers.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 89b1df4e72ab..ddd82d743bba 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4898,6 +4898,12 @@ sub process {
 				     "memory barrier without comment\n" . $herecurr);
 			}
 		}
+# check for expedited grace periods that interrupt CPUs.
+# note that synchronize_srcu_expedited() does -not- do this, so no complaints.
+		if ($line =~ /\b(synchronize_rcu_expedited|synchronize_sched_expedited)\(/) {
+			WARN("EXPEDITED_RCU_GRACE_PERIOD",
+			     "expedited RCU grace periods should be avoided\n" . $herecurr);
+		}
 # check of hardware specific defines
 		if ($line =~ m@^.\s*\#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) {
 			CHK("ARCH_DEFINES",


  parent reply	other threads:[~2015-07-02 19:22 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30 21:48 [PATCH RFC tip/core/rcu 0/5] Expedited grace periods encouraging normal ones Paul E. McKenney
2015-06-30 21:48 ` [PATCH RFC tip/core/rcu 1/5] rcu: Prepare for expedited GP driving normal GP Paul E. McKenney
2015-06-30 21:48   ` [PATCH RFC tip/core/rcu 2/5] rcu: Short-circuit normal GPs via expedited GPs Paul E. McKenney
2015-07-01 10:03     ` Peter Zijlstra
2015-07-01 13:42       ` Paul E. McKenney
2015-07-01 20:59       ` Paul E. McKenney
2015-07-01 10:05     ` Peter Zijlstra
2015-07-01 13:41       ` Paul E. McKenney
2015-07-01 13:48         ` Peter Zijlstra
2015-07-01 14:03           ` Paul E. McKenney
2015-07-02 12:03             ` Peter Zijlstra
2015-07-02 14:06               ` Paul E. McKenney
2015-07-02 16:48                 ` Peter Zijlstra
2015-07-02 19:35                   ` Paul E. McKenney
2015-07-06 14:52                     ` Peter Zijlstra
2015-06-30 21:48   ` [PATCH RFC tip/core/rcu 3/5] rcutorture: Ensure that normal GPs advance without " Paul E. McKenney
2015-06-30 21:48   ` [PATCH RFC tip/core/rcu 4/5] rcu: Wake grace-period kthread at end of expedited grace period Paul E. McKenney
2015-06-30 21:48   ` [PATCH RFC tip/core/rcu 5/5] rcu: Limit expedited helping to every 10 ms or every 4th GP Paul E. McKenney
2015-06-30 21:56     ` Eric Dumazet
2015-06-30 22:10       ` Paul E. McKenney
2015-07-01 10:07     ` Peter Zijlstra
2015-07-01 13:45       ` Paul E. McKenney
2015-07-01 19:30       ` Paul E. McKenney
2015-06-30 22:00 ` [PATCH RFC tip/core/rcu 0/5] Expedited grace periods encouraging normal ones josh
2015-06-30 22:12   ` Paul E. McKenney
2015-06-30 23:46     ` josh
2015-07-01  0:15       ` Paul E. McKenney
2015-07-01  0:42         ` Josh Triplett
2015-07-01  3:37           ` Paul E. McKenney
2015-07-01 10:12             ` Peter Zijlstra
2015-07-01 14:01               ` Paul E. McKenney
2015-07-01 14:08                 ` Eric Dumazet
2015-07-01 15:58                   ` Paul E. McKenney
2015-07-01 15:43             ` Josh Triplett
2015-07-01 15:59               ` Paul E. McKenney
2015-07-01 10:09       ` Peter Zijlstra
2015-07-01 10:55         ` Peter Zijlstra
2015-07-01 14:00           ` Paul E. McKenney
2015-07-01 14:17             ` Peter Zijlstra
2015-07-01 16:17               ` Paul E. McKenney
2015-07-01 17:02                 ` Peter Zijlstra
2015-07-01 20:09                   ` Paul E. McKenney
2015-07-01 21:20                     ` josh
2015-07-01 21:49                       ` Paul E. McKenney
2015-07-02  7:47                     ` Ingo Molnar
2015-07-02 13:58                       ` Paul E. McKenney
2015-07-02 18:35                         ` Ingo Molnar
2015-07-02 18:47                           ` Mathieu Desnoyers
2015-07-02 19:23                             ` Paul E. McKenney
2015-07-02 21:07                               ` Mathieu Desnoyers
2015-07-02 19:22                           ` Paul E. McKenney [this message]
2015-07-02  1:11                 ` Mike Galbraith
2015-07-02  1:34                   ` josh
2015-07-02  1:59                     ` Mike Galbraith
2015-07-02  2:18                       ` Paul E. McKenney
2015-07-02  2:50                         ` Mike Galbraith
2015-07-02  3:15                           ` 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=20150702192200.GO3717@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=bobby.prani@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=dvhart@linux.intel.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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.