From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: mingo@elte.hu, laijs@cn.fujitsu.com, dipankar@in.ibm.com,
akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca,
josh@joshtriplett.org, dvhltc@us.ibm.com, niv@us.ibm.com,
tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org,
Valdis.Kletnieks@vt.edu, dhowells@redhat.com,
eric.dumazet@gmail.com,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: [PATCH RFC tip/core/rcu 01/10] rcu: substitute set_need_resched for sending resched IPIs
Date: Mon, 5 Apr 2010 11:34:23 -0700 [thread overview]
Message-ID: <1270492472-23222-1-git-send-email-paulmck@linux.vnet.ibm.com> (raw)
In-Reply-To: <20100405183403.GA23075@linux.vnet.ibm.com>
This patch adds a check to __rcu_pending() that does a local
set_need_resched() if the current CPU is holding up the current grace
period and if force_quiescent_state() will be called soon. The goal is
to reduce the probability that force_quiescent_state() will need to do
smp_send_reschedule(), which sends an IPI and is therefore more expensive
on most architectures.
Signed-off-by: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
---
kernel/rcutree.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 3ec8160..e54c123 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1499,6 +1499,16 @@ static int __rcu_pending(struct rcu_state *rsp, struct rcu_data *rdp)
/* Is the RCU core waiting for a quiescent state from this CPU? */
if (rdp->qs_pending) {
+
+ /*
+ * If force_quiescent_state() coming soon and this CPU
+ * needs a quiescent state, and this is either RCU-sched
+ * or RCU-bh, force a local reschedule.
+ */
+ if (!rdp->preemptable &&
+ ULONG_CMP_LT(ACCESS_ONCE(rsp->jiffies_force_qs) - 1,
+ jiffies))
+ set_need_resched();
rdp->n_rp_qs_pending++;
return 1;
}
--
1.7.0
next prev parent reply other threads:[~2010-04-05 18:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-05 18:34 [PATCH RFC tip/core/rcu 0/10] rcu: patches queued for 2.6.35 Paul E. McKenney
2010-04-05 18:34 ` Paul E. McKenney [this message]
2010-04-05 18:34 ` [PATCH RFC tip/core/rcu 02/10] rcu: make dead code really dead Paul E. McKenney
2010-04-05 18:49 ` Mathieu Desnoyers
2010-04-05 18:56 ` Paul E. McKenney
2010-04-05 18:34 ` [PATCH RFC tip/core/rcu 03/10] rcu: move some code from macro to function Paul E. McKenney
2010-04-05 18:34 ` [PATCH RFC tip/core/rcu 04/10] rcu: ignore offline CPUs in last non-dyntick-idle CPU check Paul E. McKenney
2010-04-05 18:34 ` [PATCH RFC tip/core/rcu 05/10] rcu: Fix bogus CONFIG_PROVE_LOCKING in comments to reflect reality Paul E. McKenney
2010-04-05 18:34 ` [PATCH RFC tip/core/rcu 06/10] rcu: fix now-bogus rcu_scheduler_active comments Paul E. McKenney
2010-04-05 18:34 ` [PATCH RFC tip/core/rcu 07/10] rcu: shrink rcutiny by making synchronize_rcu_bh() be inline Paul E. McKenney
2010-04-05 18:34 ` [PATCH RFC tip/core/rcu 08/10] rcu: rename rcutiny rcu_ctrlblk to rcu_sched_ctrlblk Paul E. McKenney
2010-04-05 18:34 ` [PATCH RFC tip/core/rcu 09/10] rcu: refactor RCU's context-switch handling Paul E. McKenney
2010-04-05 18:34 ` [PATCH RFC tip/core/rcu 10/10] rcu: slim down rcutiny by removing rcu_scheduler_active and friends 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=1270492472-23222-1-git-send-email-paulmck@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=Valdis.Kletnieks@vt.edu \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=dipankar@in.ibm.com \
--cc=dvhltc@us.ibm.com \
--cc=eric.dumazet@gmail.com \
--cc=josh@joshtriplett.org \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@polymtl.ca \
--cc=mingo@elte.hu \
--cc=niv@us.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®