Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp5019574imm; Mon, 14 May 2018 18:02:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoXKXp4T4DiayNl7vL/k6I1bXdDNIZaflFdHAeNNBpAGUakvMvPrxb2xYSke3KIfQBOWSEr X-Received: by 2002:a63:894a:: with SMTP id v71-v6mr10400918pgd.423.1526346134894; Mon, 14 May 2018 18:02:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526346134; cv=none; d=google.com; s=arc-20160816; b=PCKrLPgPdLx/FBAk0EstRGZ+w4aoP5PEkAocPh+5miyWTgx/UjXP2CedjJF/MWqJhB f37xSHixGjgpbyg1qoWla7+O+bmptBAn/BQWuTIL2sjoqFw2qDfjjrnH6Tpt7WUZBh7x F38oXk2onAdmWBlPEcJEUVE7ZK2Q5RAzri/nAnR0FR44DTguBDdiW7C3aRu46tCW8jCT JmdYrei1j8aLmVHihcSxhktFdUi+pC2dFWG5JXWYDov7yJQz1qxC7P9VX7aH0xTCHkoQ Qt30MFi9Iz9tR7GnG0a7OEUSYRT8r8uwSOuJT52O5sWuCt/t7MZsRAp5UlJ9ImD3kpL6 Mpdg== 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=n3IPh2W12MdFAh0+YE+p+YKbnms3lTpPD/4LoUPbfJw=; b=VQqYGIBNyddy4hppuNX5oKAPHK0H5cAQyAws+FgLvdGZdnz2t/NJryWzWB/73yABPK 3XRAdX5wDyqjztoHNm/Wf5x8FWVLgXB38f9/efsgMcWNGlQMT3DBphc/9pXIzKxD15EV LbdiL7EjJkAu3aNPLwaBAJYxIpzLsOesXS4Dj1Gw/1XD1TLhHweUr3ilASk9kzrhDxPH i7eBLsmuahlbAykDxYLnpYPwQE6jCYe2lyIiU0DRHUvsVU0gLvmAbku0Pb+JE4FY9Z72 5NvgZeMJqFndo+76KRZegjzvh6WUF248HKZkFpLvVl0r0JlQyYYbLzxu9+NXHGDmbXP+ pPww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes-org.20150623.gappssmtp.com header.s=20150623 header.b=PlagtaJJ; 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 a5-v6si10828888pfc.106.2018.05.14.18.01.59; Mon, 14 May 2018 18:02:14 -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=PlagtaJJ; 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 S1752410AbeEOBBe (ORCPT + 99 others); Mon, 14 May 2018 21:01:34 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:42515 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752139AbeEOBBc (ORCPT ); Mon, 14 May 2018 21:01:32 -0400 Received: by mail-pg0-f67.google.com with SMTP id p9-v6so6210895pgc.9 for ; Mon, 14 May 2018 18:01: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=n3IPh2W12MdFAh0+YE+p+YKbnms3lTpPD/4LoUPbfJw=; b=PlagtaJJqQlykmtPXJEBWXeB7HReiHV6iYa8OYFXhCg8RBYY7DLo1vypOJ5qBmqneR gsy1DZSIl8bU+nJQc9zGRFUKMC2uVtyngeH8cxzLkz6xMjID5ObUDZ6a8vNmI+LrAG8r L2mO7GPxJEGcKnK2DggNJ03+kL+wgFW46/OtEhXgjW+wy14ZHDiStvOEOQMnp/ZIszHm 8qvlwN6idfxzF3mi87tbsgbUdSd+eFY7/prO+A/Kz5TEp13oLLTFJKo9GiwXV5QZBy1o qC1ryK/CapTKCW84EWIAy1zIcc46qkvTU5qLjMGEYn820TS+ImO2lQv+CmG+TG7hKUtK pRtw== 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=n3IPh2W12MdFAh0+YE+p+YKbnms3lTpPD/4LoUPbfJw=; b=s9SGcOpgNkdQy8XffxWqOdbrWEIeKJyqZJCQDeZzaEGlk/PcwA6pdZCmLwkP7li8jH hHEVQKsPCDrlTS/63Mqe5lM8+O2rXAXBrRUeb2x1QKxdZntwnyP/me83KthA23zRoqf8 pGGfQCGw+5X6y72OSNUIVr8k8z5/P06+xTmFyJOKPzOFBzMhBI/OMpJUnVIijVxcyzdJ V+xUs1HIttNLu59kDIQjzcn0nzfxkdoe71n8p9VAQusXkQLLnFLAbuoiQwgoeoAaeYvx WC/daZMKWDxe5twNxlQ5GzPcKxmy02k7g8hY0MZPyPqIoc7j1UIPi1x+O3PNRvqOteuS 3qkw== X-Gm-Message-State: ALKqPweKjTaGDWIJN5Y2frlOYmqqZD1SFI71mW838oxICoh3R5SMbaxx g3psp2OxlOcsRy/FYGa0s2EIOg== X-Received: by 2002:a65:62d0:: with SMTP id m16-v6mr10002660pgv.279.1526346092504; Mon, 14 May 2018 18:01:32 -0700 (PDT) Received: from localhost ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id 68-v6sm21083996pff.35.2018.05.14.18.01.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 May 2018 18:01:31 -0700 (PDT) Date: Mon, 14 May 2018 18:01:31 -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 7/8] rcu: trace CleanupMore condition only if needed Message-ID: <20180515010131.GF209519@joelaf.mtv.corp.google.com> References: <20180514031541.67247-1-joel@joelfernandes.org> <20180514031541.67247-8-joel@joelfernandes.org> <20180514192028.GG26088@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180514192028.GG26088@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 12:20:28PM -0700, Paul E. McKenney wrote: > On Sun, May 13, 2018 at 08:15:40PM -0700, Joel Fernandes (Google) wrote: > > Currently the tree RCU clean up code records a CleanupMore trace event > > even if the GP was already in progress. This makes CleanupMore show up > > twice for no reason. Avoid it. > > > > Signed-off-by: Joel Fernandes (Google) > > Good catch, and I applied this patch. I did rework the commit log > a bit, so please look it over to make sure I didn't mess it up. > > Thanx, Paul > > ------------------------------------------------------------------------ > > commit 52c4e689efd975f5383895b1bc1b91bc90fdd372 > Author: Joel Fernandes (Google) > Date: Sun May 13 20:15:40 2018 -0700 > > rcu: Produce last "CleanupMore" trace only if late-breaking request > > Currently the tree RCU clean-up code records a "CleanupMore" trace > event in response to late-arriving grace-period requests even if the > grace period was already requested. This makes "CleanupMore" show up an > extra time (in addition to once for each rcu_node structure that was > previously marked with the request) for no good reason. This commit > therefore avoids emitting this trace message unless the only if the only > request for this next grace period arrived during or after the cleanup > scan of the rcu_node structures. Yes, this is fine except "unless the only if the only" should be "unless the". thanks, - Joel > > Signed-off-by: Joel Fernandes (Google) > Signed-off-by: Paul E. McKenney > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > index 8063a0478870..de6447dd73de 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -2072,7 +2072,7 @@ static void rcu_gp_cleanup(struct rcu_state *rsp) > rsp->gp_state = RCU_GP_IDLE; > /* Check for GP requests since above loop. */ > rdp = this_cpu_ptr(rsp->rda); > - if (ULONG_CMP_LT(rnp->gp_seq, rnp->gp_seq_needed)) { > + if (!needgp && ULONG_CMP_LT(rnp->gp_seq, rnp->gp_seq_needed)) { > trace_rcu_this_gp(rnp, rdp, rnp->gp_seq_needed, > TPS("CleanupMore")); > needgp = true; >