mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Lai Jiangshan <laijs@cn.fujitsu.com>, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: [PATCH 2/2] rcu: Stop checking quiescent states after grace period completion from remote
Date: Wed, 24 Nov 2010 01:31:13 +0100	[thread overview]
Message-ID: <1290558673-23580-3-git-send-crap-fweisbec@gmail.com> (raw)
In-Reply-To: <1290558673-23580-1-git-send-crap-fweisbec@gmail.com>

After a CPU starts to chase its quiescent states by setting
rdp->qs_pending to 1, it can still enter into an extended
quiescent state and then another CPU will take care of this
and complete the grace period if necessary.

rcu_report_qs_rdp() currently doesn't handle well this case
and considers it must try later to notify its quiescent state.

However if the last grace period has been completed there is
nothing left to do for the current CPU.

It means that until a next grace period starts, the CPU that
runs into that case will keep chasing its own quiescent states
by raising a softirq on every tick for no good reason.

This can take a while before a new grace period starts and
this time slice is covered by spurious softirqs and other
kinds of rcu checks.

Fix this by resetting rdp->qs_pending if the last grace
period has been completed by a remote CPU while we were
in an extended quiescent state.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/rcutree.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 5f038a1..f287eaa 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -937,6 +937,15 @@ rcu_report_qs_rdp(int cpu, struct rcu_state *rsp, struct rcu_data *rdp, long las
 		 * race occurred.
 		 */
 		rdp->passed_quiesc = 0;	/* try again later! */
+
+		/*
+		 * Another CPU may have taken care of us if we were in an
+		 * extended quiescent state, in which case we don't need
+		 * to continue to track anything.
+		 */
+		if (rnp->gpnum == rnp->completed)
+			rdp->qs_pending = 0;
+
 		raw_spin_unlock_irqrestore(&rnp->lock, flags);
 		return;
 	}
-- 
1.7.1


  parent reply	other threads:[~2010-11-24  0:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-24  0:31 [PATCH 0/2] rcu: Fix series of spurious RCU softirqs Frederic Weisbecker
2010-11-24  0:31 ` [PATCH 1/2] rcu: Don't chase unnecessary quiescent states after extended grace periods Frederic Weisbecker
2010-11-24  0:58   ` Paul E. McKenney
2010-11-24  2:29     ` Frederic Weisbecker
2010-11-24  2:33       ` Frederic Weisbecker
2010-11-24  6:22         ` Paul E. McKenney
2010-11-24 13:48           ` Frederic Weisbecker
2010-11-24 14:42             ` Paul E. McKenney
2010-11-24 15:45               ` Frederic Weisbecker
2010-11-24 16:15                 ` Paul E. McKenney
2010-11-24 17:38                   ` Frederic Weisbecker
2010-11-24 18:20                     ` Paul E. McKenney
2010-11-24 20:22                       ` Paul E. McKenney
2010-11-24 20:45                         ` Frederic Weisbecker
2010-11-24 21:19                           ` Paul E. McKenney
2010-11-24 21:50                             ` Frederic Weisbecker
2010-11-24 22:42                       ` Frederic Weisbecker
2010-11-25 14:56                         ` Paul E. McKenney
2010-11-26 14:06                           ` Frederic Weisbecker
2010-11-29 23:06                             ` Paul E. McKenney
2010-11-24  0:31 ` Frederic Weisbecker [this message]
2010-11-24  1:03   ` [PATCH 2/2] rcu: Stop checking quiescent states after grace period completion from remote Paul E. McKenney
2010-11-25  3:42 ` [PATCH 0/2] rcu: Fix series of spurious RCU softirqs Lai Jiangshan
2010-11-25  7:38   ` Frederic Weisbecker
2010-11-25  8:35     ` Lai Jiangshan
2010-11-25  9:27       ` Frederic Weisbecker
2010-11-25 14:58         ` 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=1290558673-23580-3-git-send-crap-fweisbec@gmail.com \
    --to=fweisbec@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulmck@linux.vnet.ibm.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome