From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755410Ab1H3Pdw (ORCPT ); Tue, 30 Aug 2011 11:33:52 -0400 Received: from mail-ww0-f42.google.com ([74.125.82.42]:53333 "EHLO mail-ww0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755235Ab1H3Pdv (ORCPT ); Tue, 30 Aug 2011 11:33:51 -0400 Date: Tue, 30 Aug 2011 17:33:46 +0200 From: Frederic Weisbecker To: Peter Zijlstra Cc: LKML , Andrew Morton , Anton Blanchard , Avi Kivity , Ingo Molnar , Lai Jiangshan , "Paul E . McKenney" , Stephen Hemminger , Thomas Gleixner , Tim Pepper , Paul Menage Subject: Re: [PATCH 05/32] nohz: Move rcu dynticks idle mode handling to idle enter/exit APIs Message-ID: <20110830153343.GW9748@somewhere.redhat.com> References: <1313423549-27093-6-git-send-email-fweisbec@gmail.com> <1314627922.2816.65.camel@twins> <20110829171155.GD9748@somewhere.redhat.com> <1314640155.2816.117.camel@twins> <20110829175954.GF9748@somewhere.redhat.com> <1314641160.2816.128.camel@twins> <20110829233521.GK9748@somewhere.redhat.com> <1314703315.2799.5.camel@twins> <20110830143207.GP9748@somewhere.redhat.com> <1314717993.5812.11.camel@twins> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1314717993.5812.11.camel@twins> 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, Aug 30, 2011 at 05:26:33PM +0200, Peter Zijlstra wrote: > On Tue, 2011-08-30 at 16:32 +0200, Frederic Weisbecker wrote: > > On Tue, Aug 30, 2011 at 01:21:55PM +0200, Peter Zijlstra wrote: > > > On Tue, 2011-08-30 at 01:35 +0200, Frederic Weisbecker wrote: > > > > > That means it has to be in an extended grace period when we stop the > > > > > tick. > > > > > > > > You mean extended quiescent state? > > > > > > Yeah that :-) > > > > > > > As a summary here is what we do: > > > > > > > > - if we are in the kernel, we can't run into extended quiescent state because > > > > we may make use of rcu anytime there. But if we run nohz we don't have the tick > > > > to notice quiescent states to the RCU machinery and help completing grace periods > > > > so as soon as we receive an rcu IPI from another CPU (due to the grace period > > > > beeing extended because our nohz CPU doesn't report quiescent states), we restart > > > > the tick. We are optimistic enough to consider that we may avoid a lot of ticks > > > > even if there are some risks to be disturbed in some random rates. > > > > So even with the IPI we consider it as an upside. > > > > > > > > - if we are in userspace we can run in extended quiescent state. > > > > > > But you can only disable the tick/enter extended quiescent state while > > > in kernel-space. Thus the second clause is precluded from ever being > > > true. > > > > No, we have a specific stacking in the irq: > > > > rcu_irq_enter() > > > > disable tick... > > if (user) > > rcu_enter_nohz(); > > > > rcu_irq_exit() <-- extended quiescent state entry effective only there > > > > And by the time we call rcu_irq_exit() and we resume to userspace, we are > > not supposed to have rcu read side critical section (minus the case of > > a signal with do_notify_resume() which I have yet to handle). > > See all that is still kernelspace ;-) I think I know what you mean to > say though, but seeing as you note there is even now a known shortcoming > I'm not very confident its a solid construction. What will help us find > such holes? This: https://lkml.org/lkml/2011/6/23/744 It's in one of Paul's branches and should make it for the next merge window. This should detect any of such holes. I made that on purpose for the nohz cpusets when I saw how much error prone that can be with rcu :) > I would much rather we not rely on such fragile things too much.. this > RCU stuff wants way more thought, as it stands your patch-set doesn't do > anything useful IMO. Not sure what you mean. Well that Rcu thing for sure is fragile but we have the tools ready to find the problems.