From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759999Ab2EWN5e (ORCPT ); Wed, 23 May 2012 09:57:34 -0400 Received: from mail-qc0-f174.google.com ([209.85.216.174]:35747 "EHLO mail-qc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755248Ab2EWN5c (ORCPT ); Wed, 23 May 2012 09:57:32 -0400 Date: Wed, 23 May 2012 15:57:24 +0200 From: Frederic Weisbecker To: "Paul E. McKenney" Cc: LKML , linaro-sched-sig@lists.linaro.org, Alessio Igor Bogani , Andrew Morton , Avi Kivity , Chris Metcalf , Christoph Lameter , Daniel Lezcano , Geoff Levand , Gilad Ben Yossef , Hakan Akkan , Ingo Molnar , Kevin Hilman , Max Krasnyansky , Peter Zijlstra , Stephen Hemminger , Steven Rostedt , Sven-Thorsten Dietrich , Thomas Gleixner Subject: Re: [PATCH 16/41] rcu: Restart the tick on non-responding adaptive nohz CPUs Message-ID: <20120523135717.GC1663@somewhere> References: <1335830115-14335-1-git-send-email-fweisbec@gmail.com> <1335830115-14335-17-git-send-email-fweisbec@gmail.com> <20120522172050.GB8087@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120522172050.GB8087@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 22, 2012 at 10:20:50AM -0700, Paul E. McKenney wrote: > On Tue, May 01, 2012 at 01:54:50AM +0200, Frederic Weisbecker wrote: > > When a CPU in adaptive nohz mode doesn't respond to complete > > a grace period, issue it a specific IPI so that it restarts > > the tick and chases a quiescent state. > > Hello, Frederic, > > I don't understand the need for this patch. If the CPU is in > adaptive-tick mode, RCU should see it as being in dyntick-idle mode, > right? If so, shouldn't RCU have already recognized the CPU as being > in an extended quiescent state? > > Or is this a belt-and-suspenders situation? > > Thanx, Paul If the tickless CPU is in userspace, it is in extended quiescent state. But not if it runs tickless in the kernel. In this case we need to send it an IPI so that it restarts the tick after checking rcu_pending(). > > > Signed-off-by: Frederic Weisbecker > > Cc: Alessio Igor Bogani > > Cc: Andrew Morton > > Cc: Avi Kivity > > Cc: Chris Metcalf > > Cc: Christoph Lameter > > Cc: Daniel Lezcano > > Cc: Geoff Levand > > Cc: Gilad Ben Yossef > > Cc: Hakan Akkan > > Cc: Ingo Molnar > > Cc: Kevin Hilman > > Cc: Max Krasnyansky > > Cc: Paul E. McKenney > > Cc: Peter Zijlstra > > Cc: Stephen Hemminger > > Cc: Steven Rostedt > > Cc: Sven-Thorsten Dietrich > > Cc: Thomas Gleixner > > --- > > kernel/rcutree.c | 17 +++++++++++++++++ > > 1 files changed, 17 insertions(+), 0 deletions(-) > > > > diff --git a/kernel/rcutree.c b/kernel/rcutree.c > > index e141c7e..3fffc26 100644 > > --- a/kernel/rcutree.c > > +++ b/kernel/rcutree.c > > @@ -50,6 +50,7 @@ > > #include > > #include > > #include > > +#include > > > > #include "rcutree.h" > > #include > > @@ -302,6 +303,20 @@ static struct rcu_node *rcu_get_root(struct rcu_state *rsp) > > > > #ifdef CONFIG_SMP > > > > +static void cpuset_update_rcu_cpu(int cpu) > > +{ > > +#ifdef CONFIG_CPUSETS_NO_HZ > > + unsigned long flags; > > + > > + local_irq_save(flags); > > + > > + if (cpuset_cpu_adaptive_nohz(cpu)) > > + smp_cpuset_update_nohz(cpu); > > + > > + local_irq_restore(flags); > > +#endif > > +} > > + > > /* > > * If the specified CPU is offline, tell the caller that it is in > > * a quiescent state. Otherwise, whack it with a reschedule IPI. > > @@ -325,6 +340,8 @@ static int rcu_implicit_offline_qs(struct rcu_data *rdp) > > return 1; > > } > > > > + cpuset_update_rcu_cpu(rdp->cpu); > > + > > /* > > * The CPU is online, so send it a reschedule IPI. This forces > > * it through the scheduler, and (inefficiently) also handles cases > > -- > > 1.7.5.4 > > >