Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2611599imm; Wed, 16 May 2018 16:13:58 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpef17qQ2Q6C4hFXs2sAr+WGpNwxSxkZQ6wf5m7uwSkl1Lz3t8V/CyR/0WPFDYfhmJtWD71 X-Received: by 2002:a63:6d47:: with SMTP id i68-v6mr2290966pgc.59.1526512438396; Wed, 16 May 2018 16:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526512438; cv=none; d=google.com; s=arc-20160816; b=aZ1R9ZPm10daQSc3OPQcrEdjOrkuUvneSzB+3b948yDiDdM8Ed6lbv5Daim+4u5qvE q6WAcQE+KECZsjGk8HzDYS+mZq4xEstV/IwYWmkMBfVb6hdmXfR76dwnHnL6TMUm3Vz2 cEwdXR6yqVDn9/XD8Ms5x1etZb9uWrP0OgBdUExqyQwnmJdnVMWDk56dLNBVnqXsr7Az a+d1PXgYV5TI17a528DkMwYG3/rAn1GBsWsM6QW0vR40FnfD/xE8tUZnIYqoCSjLUUMF n+xJXd+0JpFyNEFyN/wDnsF5pWLrQPnPM4vrQTOhlNusn+Db8TeM7qjQ/a2kLT7JfEyK cSWw== 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=QtX8k2W4b0V4cOFTXdZ/gJgY3U4mJAbb+SO/vhg7cec=; b=BeQk8P6KcpslFWbyhvGUW+zFCQgQGlcG3FCvVHf8Z0H9xlm/jybTTN3E5+5zs15zkO kvdnZwsyO8IAvMFzklGJZmdBDsCD5JzLbyT7exM9NQ19M+hzH4Dta+LNSAgmYXNHf+5w zEqVb/Ef0f/dbJ1G14vfeVsl681OAUWdVKM0r4mPIEz+56pBenerCjc4WUSVHsHn7PZF 7kQ2IaX8c+IECNC86d3G0aEVOgBrOjgk7zW5bZICqXp4sMFMzZta/hfVoAK1B6XkG2ZG GU7ahozvzfHcj02RljVkEf6KayEqmF3oBsc+M45mQmPpvLjEkaOLM8VPCbDdJtD7geps XVsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=Nu5C3VG/; 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 r2-v6si3608074pli.370.2018.05.16.16.13.44; Wed, 16 May 2018 16:13:58 -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 header.s=google header.b=Nu5C3VG/; 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 S1751642AbeEPXNI (ORCPT + 99 others); Wed, 16 May 2018 19:13:08 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:45398 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751227AbeEPXNH (ORCPT ); Wed, 16 May 2018 19:13:07 -0400 Received: by mail-pg0-f68.google.com with SMTP id w3-v6so924739pgv.12 for ; Wed, 16 May 2018 16:13:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QtX8k2W4b0V4cOFTXdZ/gJgY3U4mJAbb+SO/vhg7cec=; b=Nu5C3VG/4vnF8XPbgvZUwu/Ajr2y/X6PHTpol2BfATeLb5uAdWAC8c3pgom+bIF4b3 w71z37KCKIZ+LaqzYpw4OIZD45rWFakpKcQtSu379mJsyVom6zowJ2yrk+4KPABdQInQ xFXigZBTxbtdZSfdFc34wNCeG5b6vZR6xJh9w= 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=QtX8k2W4b0V4cOFTXdZ/gJgY3U4mJAbb+SO/vhg7cec=; b=ZYMGMuYAFXKfOZPQl+GFs+x1OyOmW6ptAHOutAcZ8xRJRKnh+uc+laKDEAX7GZiTXH 3uII/9DZ51YVwkKgUqB5AK5d7PcV2tunqRqXX+TMcQKse15Z3ed4Gc9moOLeTrxM26nL VvegP1REceLcOw+5tDOhW63BmlZz/0/HsP44hxzj6esjcDn037RYgMq38WabsDO7RQYw EVz3kSbhVEujzYYIM7CCyP1krC5aZb+mUj2Cz95rQfXEwD3FfytkkyRcST5Rq6Sthwd/ WkU9Pqp+owYmUcJnYF+vnoxV6ETX+x+joofIWZeT1ZFmLkvrQ+TY0PdjOuKwIfLNqr21 vCqg== X-Gm-Message-State: ALKqPwe/k2Lb0EhUXR+ROhJ15lQFhJaqz6RBw1DORbkJptTXD36RxjJq /bPctAGa+rKphW8hczQzXjyD8Q== X-Received: by 2002:a65:63c1:: with SMTP id n1-v6mr2168122pgv.399.1526512386605; Wed, 16 May 2018 16:13:06 -0700 (PDT) Received: from localhost ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id g207-v6sm6194268pfb.18.2018.05.16.16.13.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 May 2018 16:13:05 -0700 (PDT) Date: Wed, 16 May 2018 16:13:05 -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: <20180516231305.GB221547@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> <20180515230430.GB7510@joelaf.mtv.corp.google.com> <20180516154829.GE3803@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180516154829.GE3803@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 Wed, May 16, 2018 at 08:48:29AM -0700, Paul E. McKenney wrote: > On Tue, May 15, 2018 at 04:04:30PM -0700, Joel Fernandes wrote: > > 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". > > After the first iteration, the check after setting ->gp_seq_needed is > dead code. If that check would have succeeded, the same check in the > big "if" statement would have taken the early exit. Oh yes, ofcourse!! I understand it now. thanks, - Joel