Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752813AbbF3V4s (ORCPT ); Tue, 30 Jun 2015 17:56:48 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:34900 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751882AbbF3V4j (ORCPT ); Tue, 30 Jun 2015 17:56:39 -0400 MIME-Version: 1.0 In-Reply-To: <1435700910-9104-5-git-send-email-paulmck@linux.vnet.ibm.com> References: <20150630214805.GA7795@linux.vnet.ibm.com> <1435700910-9104-1-git-send-email-paulmck@linux.vnet.ibm.com> <1435700910-9104-5-git-send-email-paulmck@linux.vnet.ibm.com> Date: Tue, 30 Jun 2015 23:56:37 +0200 Message-ID: Subject: Re: [PATCH RFC tip/core/rcu 5/5] rcu: Limit expedited helping to every 10 ms or every 4th GP From: Eric Dumazet To: "Paul E. McKenney" Cc: LKML , Ingo Molnar , laijs@cn.fujitsu.com, dipankar@in.ibm.com, Andrew Morton , mathieu.desnoyers@efficios.com, josh@joshtriplett.org, Thomas Gleixner , peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, dvhart@linux.intel.com, fweisbec@gmail.com, oleg@redhat.com, bobby.prani@gmail.com Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1709 Lines: 47 On Tue, Jun 30, 2015 at 11:48 PM, Paul E. McKenney wrote: > From: "Paul E. McKenney" > > Signed-off-by: Paul E. McKenney > --- > 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; Do you want 10 ticks or 10 ms (as stated in title) ? > + 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/