Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1174788

[PATCH RFC tip/core/rcu 5/5] rcu: Limit expedited helping to every 10 ms or every 4th GP

From "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [PATCH RFC tip/core/rcu 5/5] rcu: Limit expedited helping to every 10 ms or every 4th GP
Date 2015-06-30 23:50 +0200
Message-ID <pHbzI-5V3-27@gated-at.bofh.it> (permalink)
References <pHbzH-5V3-5@gated-at.bofh.it> <pHbzH-5V3-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcu/tree.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 308b6acb4260..247aa1120c4c 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3505,10 +3505,19 @@ void synchronize_sched_expedited(void)
 			   !atomic_read(&rsp->expedited_need_qs));
 
 	rcu_exp_gp_seq_end(rsp);
-	mutex_unlock(&rnp->exp_funnel_mutex);
 	smp_mb(); /* ensure subsequent action seen after grace period. */
-	if (rsp->gp_kthread && rcu_gp_in_progress(rsp))
-		wake_up(&rsp->gp_wq);
+	if (rsp->gp_kthread && rcu_gp_in_progress(rsp)) {
+		static unsigned long nextgp;
+		static unsigned long nextjiffy;
+
+		if (time_after_eq(jiffies, nextgp) ||
+		    ULONG_CMP_GE(rsp->gpnum, nextgp)) {
+			nextgp = rsp->gpnum + 4;
+			nextjiffy = jiffies + 10;
+			wake_up(&rsp->gp_wq);
+		}
+	}
+	mutex_unlock(&rnp->exp_funnel_mutex);
 
 	put_online_cpus();
 }
-- 
1.8.1.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH RFC tip/core/rcu 0/5] Expedited grace periods encouraging  normal ones "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-06-30 23:50 +0200
  [PATCH RFC tip/core/rcu 5/5] rcu: Limit expedited helping to every 10 ms or every 4th GP "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-06-30 23:50 +0200
    Re: [PATCH RFC tip/core/rcu 5/5] rcu: Limit expedited helping to  every 10 ms or every 4th GP Eric Dumazet <edumazet@google.com> - 2015-07-01 00:00 +0200
  [PATCH RFC tip/core/rcu 1/5] rcu: Prepare for expedited GP driving normal GP "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-06-30 23:50 +0200
  Re: [PATCH RFC tip/core/rcu 0/5] Expedited grace periods  encouraging normal ones josh@joshtriplett.org - 2015-07-01 00:10 +0200
    Re: [PATCH RFC tip/core/rcu 0/5] Expedited grace periods encouraging  normal ones Josh Triplett <josh@joshtriplett.org> - 2015-07-01 02:50 +0200
    Re: [PATCH RFC tip/core/rcu 0/5] Expedited grace periods  encouraging normal ones josh@joshtriplett.org - 2015-07-01 23:30 +0200
      Re: [PATCH RFC tip/core/rcu 0/5] Expedited grace periods encouraging  normal ones "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-07-01 23:50 +0200
    Re: [PATCH RFC tip/core/rcu 0/5] Expedited grace periods  encouraging normal ones Mike Galbraith <umgwanakikbuti@gmail.com> - 2015-07-02 03:20 +0200
      Re: [PATCH RFC tip/core/rcu 0/5] Expedited grace periods  encouraging normal ones josh@joshtriplett.org - 2015-07-02 03:40 +0200
        Re: [PATCH RFC tip/core/rcu 0/5] Expedited grace periods  encouraging normal ones Mike Galbraith <umgwanakikbuti@gmail.com> - 2015-07-02 04:10 +0200

csiph-web