Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1225189imm; Tue, 15 May 2018 16:06:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqFvFMRAjHi8S+GzBh5P6NAAnxabduy2qaRwqedjhA6PMVnpqE5KITinfF2nJ6TFZZH+xk+ X-Received: by 2002:aa7:864d:: with SMTP id a13-v6mr14143461pfo.199.1526425579928; Tue, 15 May 2018 16:06:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526425579; cv=none; d=google.com; s=arc-20160816; b=H/jslNHP3Jcw+iXX5jK7/dyr/qJ13k5l4JdbgPQEtVbynX/bYvZoWDxpXnIDIvigwu PuctKdhTAdQ+HHzphgS0t4xGVzf5fUtC3wOEA/B04qhQadSVfP0mpA0YkuXnJ4gl1RMG DAQnp1yu7IrkZRvzvPbfZmBk5WMRcEtxEvZhaXfxjyvWBmcm53nyyNWpZXfGsOQ7WIUy jOPtYCYnNOE/yH85UkqznuWa3hTzS2N6/RyWFNsSWtpILT4d+3U72GEy6PmG+3N9VfhV IIujTEFmdA7vlSgYHwjx5OUEqO30k523xG2sxwr42vgNZvJhp7KkkDsqSGuScmdToNJY 5mrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=P1tOdwaidzyO04WhZBVpLQSnUnT2fAZtoJUxrqtTZqU=; b=q+OrID2o9D+gxaszFCMtc4xteVaNR+uWle7Zbde44vKllnUzqkL2vysIragauKzP3V ii+/qoa1L9eGtDQVMn8TiVQfqfSM5gk2iTFW4TL395TBgIuavpAIpnRTS2nO8HyNY3gV 2E935nEIV9n6xEBDDiJqtqYYZb8WYbvnblxWMtjDmsCfgdPw2RGgf7PVY4oll41Si15e mueCuELjmGjhLLmXsqkvT89QNIDXaVGzB276Rz2mzjq3Myfa0pH5itnPSl/IfImN1+fR +Q98qe3dVRXfU+qXarFMRbTdOLmm7fU1uN3DQCF0kXW56VF+fgZYjUUoxV3d2kuuvh0F 03sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes-org.20150623.gappssmtp.com header.s=20150623 header.b=Ju8JppXR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6-v6si1105433pfk.342.2018.05.15.16.06.05; Tue, 15 May 2018 16:06:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes-org.20150623.gappssmtp.com header.s=20150623 header.b=Ju8JppXR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752292AbeEOXEd (ORCPT + 99 others); Tue, 15 May 2018 19:04:33 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34566 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751104AbeEOXEc (ORCPT ); Tue, 15 May 2018 19:04:32 -0400 Received: by mail-pf0-f196.google.com with SMTP id a14-v6so786388pfi.1 for ; Tue, 15 May 2018 16:04:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=P1tOdwaidzyO04WhZBVpLQSnUnT2fAZtoJUxrqtTZqU=; b=Ju8JppXRZ7h5Pidfe2PS+ixiVU9ulYtiyH4V+UCePjWMDCMqQV12j/l7jjW67C5kqx tONqa0/IvdMnamRoV2CS4/kduzIvCH2R3MtpRq90+Pw+h43yNwgyhdMr7XkDnaJpDsSL FEioJgs7aIG8EBrKEQ37zbmCw3BuihI86uvFWwBdSoM/MILNpAkDg8YeHKgjF5cNmlJs VhnJL6OKaUwJG0BcaOhJjzKRYX4Jhv/S+PyoSFg/e4As39RzcUh4uJfsWfy1eC02tCag 01njgZjvqgxKCt0sJCXczWmot20tzMEIFH+mPRvLWjyhLH4OgBDZlaotnOMc+OQgx/kL PF/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=P1tOdwaidzyO04WhZBVpLQSnUnT2fAZtoJUxrqtTZqU=; b=aCk+1kNHXXO9KcnfN7uansi12TGVmdTuK4Fp/HletwL7YaWoA5QDoJ6Se3wLKLPB1f BCKkL6ueKvRhIhF5/X01RHL4zNnzu8RWwGXimFsaByUo2Rl4kgCyJz/aqARL528/hJ8g ffobjp4FfA3O+kLahYVGczETOyAZiz6owoULrJws1xmosbq3P3fPAJg6KGuP4Mpkaul9 n18X7/3u5v8i8Flx7uxdOfUn3z+5/tTLBe85vb4cStS6yy7OGNAW2yN83ok/6qeejk3N sxiUPp5XDbe6vxvDJH8NPm54YgCO5CT2ohzKtfkDLd5SqGrNHjzm3PiZEMpTzlq1lRdr VJxg== X-Gm-Message-State: ALKqPwfA4Baeq+NdP16GeSyDncS0w/BAasj8C2R9gN/7jkBCBFYU5GIR jzKSYNABI1BgGCAzyVJiSM68ZQ== X-Received: by 2002:a62:9b8d:: with SMTP id e13-v6mr17262535pfk.157.1526425471948; Tue, 15 May 2018 16:04:31 -0700 (PDT) Received: from localhost ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id q76-v6sm1413333pfi.139.2018.05.15.16.04.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 May 2018 16:04:31 -0700 (PDT) Date: Tue, 15 May 2018 16:04:30 -0700 From: Joel Fernandes To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , byungchul.park@lge.com, kernel-team@android.com Subject: Re: [PATCH RFC 6/8] rcu: Add back the Startedleaf tracepoint Message-ID: <20180515230430.GB7510@joelaf.mtv.corp.google.com> References: <20180514031541.67247-1-joel@joelfernandes.org> <20180514031541.67247-7-joel@joelfernandes.org> <20180514183823.GF26088@linux.vnet.ibm.com> <20180515005709.GE209519@joelaf.mtv.corp.google.com> <20180515034603.GY26088@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180515034603.GY26088@linux.vnet.ibm.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 14, 2018 at 08:46:03PM -0700, Paul E. McKenney wrote: > On Mon, May 14, 2018 at 05:57:09PM -0700, Joel Fernandes wrote: > > On Mon, May 14, 2018 at 11:38:23AM -0700, Paul E. McKenney wrote: > > > On Sun, May 13, 2018 at 08:15:39PM -0700, Joel Fernandes (Google) wrote: > > > > In recent discussion [1], the check for whether a leaf believes RCU is > > > > not idle, is being added back to funnel locking code, to avoid more > > > > locking. In this we are marking the leaf node for a future grace-period > > > > and bailing out since a GP is currently in progress. However the > > > > tracepoint is missing. Lets add it back. > > > > > > > > Also add a small comment about why we do this check (basically the point > > > > is to avoid locking intermediate nodes unnecessarily) and clarify the > > > > comments in the trace event header now that we are doing traversal of > > > > one or more intermediate nodes. > > > > > > > > [1] http://lkml.kernel.org/r/20180513190906.GL26088@linux.vnet.ibm.com > > > > > > > > Signed-off-by: Joel Fernandes (Google) > > > > > > Looks like a good idea, but it does not apply -- which is not a surprise, > > > given the change rate in this code. I hand-applied as a modification > > > to c1b3f9fce26f ("rcu: Don't funnel-lock above leaf node if GP in progress") > > > with attribution, but with the changes below. Please let me know if I > > > am missing something. > > > > > > Ah, I see -- this commit depends on your earlier name-change commit. > > > I therefore made this patch use the old names. > > > > Ok, I'll check your new tree and rebase. > > Sounds good! > > > > > --- > > > > include/trace/events/rcu.h | 4 ++-- > > > > kernel/rcu/tree.c | 11 ++++++++++- > > > > 2 files changed, 12 insertions(+), 3 deletions(-) > > > > > > > > diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h > > > > index 539900a9f8c7..dc0bd11739c7 100644 > > > > --- a/include/trace/events/rcu.h > > > > +++ b/include/trace/events/rcu.h > > > > @@ -91,8 +91,8 @@ TRACE_EVENT(rcu_grace_period, > > > > * > > > > * "Startleaf": Request a grace period based on leaf-node data. > > > > * "Prestarted": Someone beat us to the request > > > > - * "Startedleaf": Leaf-node start proved sufficient. > > > > - * "Startedleafroot": Leaf-node start proved sufficient after checking root. > > > > + * "Startedleaf": Leaf and one or more non-root nodes marked for future start. > > > > > > Actually, we only get to that trace if all we did was mark the leaf > > > node, right? > > > > I didn't think so. In the code we are doing the check for rnp every time we > > walk up the tree. So even when we are on an intermediate node, we do the > > check of the node we started with. I thought that's what you wanted to do. It > > makes sense to me to do so too. > > If we are not on the initial (usually leaf) node, then the similar check > in the previous "if" statement would have sent us to unlock_out, right? > > (And yes, I should have said "mark the initial node" above.) I may have missed this, sorry. Yes, that would be true unless the check could be true not at the firsti iteration, but after the first iteration? (i.e. another path started the initially idle GP). That's why I changed it to "one or more non-root nodes marked". What do you think? thanks, - Joel