Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp52287imm; Mon, 14 May 2018 20:46:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp7IDt7v5k2CLlYsWbGpPUfYR3aqaHEGyHynz7z/lqzxQbhpjDMCSJoLjtZM2CUh9S/YcNF X-Received: by 2002:a17:902:5610:: with SMTP id h16-v6mr12531797pli.140.1526355997306; Mon, 14 May 2018 20:46:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526355997; cv=none; d=google.com; s=arc-20160816; b=V6i8L/UXltqjTm53cbAHry2dhFHtpOqwDhhhRaXMrpr04zQUN7tZ53f1WDyRv+7OhS EOzVE8zBN+RULXnWSLScA+nOYQFk3DYFXjalD2bmVj31qkzo1kUirQYVzb9rL13ZNl8u MWAMHKMDuGxb4wkGCzo1O1ruTX6Pyr92kBSl/X7NYrMmeGo6BFB93JcyvH6zLOHNiYiy 4IGS6kKmTv98SVmWgxQHUt+ewIXJsziOtN6Kni/JxcVeBP5OQcqyt5CBA7T/dhY/ASv5 QcIpsw8ODjvutfOvHH6ZK39fGP6k4ecvDtJoEIlHZrrxFE1mXu6+2B2Fe4z2EzlrP11d YyrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=lkgQTQpnsIUDaYle5PZmbc/X8od/P3wOQFF3Ky1m2zI=; b=Dj8uQp7lYghX7koWl+6wJmvXzJv22kIZQlD4LThO/q1Fu9gCybDcbdfqLuoZ2cBP9q depXxAHcVGasa18JbeRVE3BIAyMsLMvxKK/4dElDiZN+TqWFxM9tF+VA4pqTfQG3SEx5 A4wMKNRLMz2YkfvnvgMEerFVwkfBlN1nK2F9v5c9lTcRLIhncgLqLAMbJKMegkYkO86L NwvmmXifXxJvDQb400DH/yQ/lmL/bRKveLrC4OBWcopzBWA7O41hvhPNvSVdOvfP37vL E3J/k3058oLkvpLUSJuXG7tTqcEnTGAD/v4PwSVcOd2mbF6jqaVSyC8k+hSS95pmx+k8 yhkw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r9-v6si11117857pfg.247.2018.05.14.20.46.22; Mon, 14 May 2018 20:46:37 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752146AbeEODqJ (ORCPT + 99 others); Mon, 14 May 2018 23:46:09 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:33394 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752060AbeEODqI (ORCPT ); Mon, 14 May 2018 23:46:08 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4F3iRMd142060 for ; Mon, 14 May 2018 23:46:07 -0400 Received: from e11.ny.us.ibm.com (e11.ny.us.ibm.com [129.33.205.201]) by mx0b-001b2d01.pphosted.com with ESMTP id 2hyp0dkeuk-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 14 May 2018 23:46:06 -0400 Received: from localhost by e11.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 14 May 2018 23:46:06 -0400 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e11.ny.us.ibm.com (146.89.104.198) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 14 May 2018 23:46:03 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4F3k2ol51707952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 15 May 2018 03:46:02 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A224AB2046; Tue, 15 May 2018 00:48:00 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.85.132.95]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 64EA6B204E; Tue, 15 May 2018 00:48:00 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id A1D3016C3BCC; Mon, 14 May 2018 20:47:33 -0700 (PDT) Date: Mon, 14 May 2018 20:47:33 -0700 From: "Paul E. McKenney" To: Joel Fernandes 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 Reply-To: paulmck@linux.vnet.ibm.com References: <20180514031541.67247-1-joel@joelfernandes.org> <20180514031541.67247-8-joel@joelfernandes.org> <20180514192028.GG26088@linux.vnet.ibm.com> <20180515010131.GF209519@joelaf.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180515010131.GF209519@joelaf.mtv.corp.google.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18051503-2213-0000-0000-000002A57396 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009027; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000260; SDB=6.01032468; UDB=6.00527835; IPR=6.00811599; MB=3.00021117; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-15 03:46:05 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18051503-2214-0000-0000-00005A1F51AC Message-Id: <20180515034733.GZ26088@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-15_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805150037 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 06:01:31PM -0700, Joel Fernandes wrote: > 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". I did update this after sending, and I still have "the the". Will fix on next rebase. As my daughter recently reminded me, the Law of Conservation of Bugs. ;-) Thanx, Paul > 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; > > >