From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753336Ab1KPTmF (ORCPT ); Wed, 16 Nov 2011 14:42:05 -0500 Received: from e4.ny.us.ibm.com ([32.97.182.144]:42015 "EHLO e4.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751980Ab1KPTmC (ORCPT ); Wed, 16 Nov 2011 14:42:02 -0500 Date: Wed, 16 Nov 2011 11:41:20 -0800 From: "Paul E. McKenney" To: Frederic Weisbecker Cc: Josh Triplett , linux-kernel@vger.kernel.org, mingo@elte.hu, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca, niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, Valdis.Kletnieks@vt.edu, dhowells@redhat.com, eric.dumazet@gmail.com, darren@dvhart.com, patches@linaro.org, Mike Frysinger , Guan Xuetao , David Miller , Chris Metcalf , Hans-Christian Egtvedt , Ralf Baechle , Ingo Molnar , Peter Zijlstra , "H. Peter Anvin" , Russell King , Paul Mackerras , Heiko Carstens , Paul Mundt Subject: Re: [PATCH RFC tip/core/rcu 19/28] nohz: Allow rcu extended quiescent state handling seperately from tick stop Message-ID: <20111116194120.GG2355@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20111102203017.GA3830@linux.vnet.ibm.com> <1320265849-5744-19-git-send-email-paulmck@linux.vnet.ibm.com> <20111103040003.GE2042@leaf> <20111103115426.GD8198@somewhere.redhat.com> <20111103133231.GA2287@linux.vnet.ibm.com> <20111103153102.GC18443@leaf> <20111103160656.GC2287@linux.vnet.ibm.com> <20111109164804.GA17538@somewhere.redhat.com> <20111110172219.GC2354@linux.vnet.ibm.com> <20111115183026.GB3234@somewhere> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111115183026.GB3234@somewhere> User-Agent: Mutt/1.5.20 (2009-06-14) x-cbid: 11111619-3534-0000-0000-00000212ACD7 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 15, 2011 at 07:30:29PM +0100, Frederic Weisbecker wrote: > On Thu, Nov 10, 2011 at 09:22:19AM -0800, Paul E. McKenney wrote: > > On Wed, Nov 09, 2011 at 05:48:11PM +0100, Frederic Weisbecker wrote: > > > On Thu, Nov 03, 2011 at 09:06:56AM -0700, Paul E. McKenney wrote: > > > > On Thu, Nov 03, 2011 at 08:31:02AM -0700, Josh Triplett wrote: > > > > > On Thu, Nov 03, 2011 at 06:32:31AM -0700, Paul E. McKenney wrote: > > > > > > On Thu, Nov 03, 2011 at 12:54:33PM +0100, Frederic Weisbecker wrote: > > > > > > > On Wed, Nov 02, 2011 at 09:00:03PM -0700, Josh Triplett wrote: > > > > > > > > On Wed, Nov 02, 2011 at 01:30:40PM -0700, Paul E. McKenney wrote: > > > > > > > > > From: Frederic Weisbecker > > > > > > > > > > > > > > > > > > It is assumed that rcu won't be used once we switch to tickless > > > > > > > > > mode and until we restart the tick. However this is not always > > > > > > > > > true, as in x86-64 where we dereference the idle notifiers after > > > > > > > > > the tick is stopped. > > > > > > > > > > > > > > > > > > To prepare for fixing this, add two new APIs: > > > > > > > > > tick_nohz_idle_enter_norcu() and tick_nohz_idle_exit_norcu(). > > > > > > > > > > > > > > > > > > If no use of RCU is made in the idle loop between > > > > > > > > > tick_nohz_enter_idle() and tick_nohz_exit_idle() calls, the arch > > > > > > > > > must instead call the new *_norcu() version such that the arch doesn't > > > > > > > > > need to call rcu_idle_enter() and rcu_idle_exit(). > > > > > > > > > > > > > > > > The _norcu names confused me a bit. At first, I thought they meant > > > > > > > > "idle but not RCU idle, so you can use RCU", but from re-reading the > > > > > > > > commit message, apparently they mean "idle and RCU idle, so don't use > > > > > > > > RCU". What about something like _forbid_rcu instead? Or, > > > > > > > > alternatively, why not just go ahead and separate the two types of idle > > > > > > > > entirely rather than introducing the _norcu variants first? > > > > > > > > > > > > > > Or tick_nohz_idle_enter_rcu_stop() and tick_nohz_idle_exit_rcu_restart()? > > > > > > > > > > > > > > Sounds clear but too long. May be we can shorten the tick_nohz thing in the > > > > > > > beginning. > > > > > > > > > > > > How about tick_nohz_rcu_idle_enter() vs. tick_nohz_idle_enter() on > > > > > > entry to the idle loop and tick_nohz_rcu_idle_exit() vs > > > > > > tick_nohz_idle_exit() on exit? > > > > > > > > > > > > That said, I don't feel all that strongly on this naming topic. > > > > > > > > > > Mostly I think that since this series tries to separate the concepts of > > > > > "idle nohz" and "rcu extended quiescent state", we should end up with > > > > > two entirely separate functions delimiting those two, without any > > > > > functions that poke both with correspondingly complex compound names. > > > > > > > > Having four API members rather than the current six does seem quite > > > > attractive to me. Frederic, any reason why this approach won't work? > > > > > > The approach I took might sound silly but it's mostly an optimization: > > > > > > I did the *_norcu() variant mostly to be able to keep rcu_idle_enter() > > > call under the same local_irq_disable() section. > > > > > > This way we can't have an interrupt in between that can needlessly perform > > > RCU work (and trigger the softirq in the worst case), delaying the point > > > where we actually put the CPU to sleep. > > > > But we have to tolerate this sort of thing on some architectures (x86 > > and Power) in order to allow idle-task use of RCU read-side primitives, > > right? > > > > So consolidating from six to four APIs doesn't expand the overall state > > space. > > Well, we tolerate that, the two more APIs are there for optimization, not > to provide correctness. > But if you want me to remove the optimization and keep only the four APIs I can do it. Probably best to start with the simpler API and expand it if performance considerations suggest that this is approapriate. Thanx, Paul