Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp5020453imm; Mon, 14 May 2018 18:03:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoRJj5+yAxJQ23l/UkxxJe5jSYyDgCsGjIBC5EmMzSv8jcBGzYKA/26wCXEwPSKnVG8uoGn X-Received: by 2002:a63:9f0a:: with SMTP id g10-v6mr10102258pge.39.1526346208402; Mon, 14 May 2018 18:03:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526346208; cv=none; d=google.com; s=arc-20160816; b=IeQWZ2M5FgPayp57pxdqsVR/Z4ra/aI+nVCnnyzGgoyGnOe81oxy1jZjmi8UaO4OeV gh80JD/xNMxmD7g+Aag58QH/dxhYPyCPlSolpkDKrTpibB7vFNXv6Xuj0lpzzQ70SO2h rZ8+g6LF7P3MmyUVOjsZ+4VNDlvP/CrQtd7hyGSfKEjZ0B+rz1i7THDTX3MthuQQTy0M NaPdEClly5M+K+PTpG45aFE0QB4cxsbEKuatmkXm5o+4Y4rd7mQ1qqzmfrB9fL6wml0w lf3s+ar7ca41exHfmQLBUOBAfL5oMr44YglFIKo4Y0MAi0GqOyjuGclRSkNhxn8PnS0d 1ZoQ== 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=V7i5AIEqnblSr88vGf3e5TUSODGaGkgYFH8vRqaN16U=; b=UieeqegP23c9PkHRpfSQNI0KiwFgvxQ2DTjcV49+GwQBBWEWHB3l0JhrrRGyva5bBA k16gtXIeVt4fUxGBdcplngpvsYP9oitu5UDuqJzMDcyfnpLZ86fd9utIxpurfwxM/8FW FAFRT94rI2IlZUkywM4X1aK9gQbF/9ftgVv9BQ/rzRMOyy/K7fYuZZXJrRxqOHj0/CMn 6Xc/PVG6lVkchfbyMgBB8Z2oAEdJD564vC7xRUBD0xgFpwIR5riIKUJ9HAHVzf50F3I+ ENOkegBF+E8zwckkkDGRyGs6U2O8sXgMZGfpn3ea62uaq17Areafi8BGNU4wb4pBsiXx kYtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes-org.20150623.gappssmtp.com header.s=20150623 header.b=y/0jfEHC; 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 e1-v6si8514764pgr.167.2018.05.14.18.03.13; Mon, 14 May 2018 18:03:28 -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=y/0jfEHC; 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 S1752491AbeEOBCt (ORCPT + 99 others); Mon, 14 May 2018 21:02:49 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:43852 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752145AbeEOBCs (ORCPT ); Mon, 14 May 2018 21:02:48 -0400 Received: by mail-pl0-f67.google.com with SMTP id c41-v6so3140374plj.10 for ; Mon, 14 May 2018 18:02:48 -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=V7i5AIEqnblSr88vGf3e5TUSODGaGkgYFH8vRqaN16U=; b=y/0jfEHCegBhDJRTfyjZGX2tGMMqQ2uqPJxWomgBhFdwJdSY2ChmJsxoh3c/6mHMbp DsbFNPA2S3yUN2XDMMGaXaX6WOcLt7X9UWUmlG14OFMo9lAr2PVyzbyfWMUnry1HZOMA ctTthTQxBCIRKeTKJZjoxhft0KQcwY17FsfCiIJoyAN9dT5ZpKr8n2mSW78Yih1MH9dB zKCNB8r/ERDpArx+ukNZGcQhDFzZQvKVs5fwJvDCnxzSX0fGCJtFVCvg3NVeGglEtU8s ktyW5zwUz1+oAIk4MeCwUfmnKv+pW+dmoJM/cvgYQVp+smtYDQCPjxoTNAg7bzbrj/XY FeSg== 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=V7i5AIEqnblSr88vGf3e5TUSODGaGkgYFH8vRqaN16U=; b=QggyNxp4rqYbdqQMLhiwzE8yr/cZmL0psWlcCRyCFCPLha+Dw+7RXs1ngJJSpT3JLW qFkV57Wmma6gV28tfH29G2RYecCqGEKDWHjDP8RRAmpOeoaAwEDzxpF4Xza+mEdbhmU7 UV6GOa+DkGxt/j9xpANYP5dkXEaIyTmfcE1leBI7RJSPqNYjkla461RCgI+nSF6iKGJ0 0IxXyl6ImfgN+snt2axGTQZDzfhBh4lP7FAUi8xl3goUPHsV2rkEd71jprZjEf252RlY 9ZnT1GjrhryO/kCo64SBkdDPkZBCKmHVq5Hogq13JAQiEaVXgnXCZVCnHLDTetxOBEgd 9fiQ== X-Gm-Message-State: ALKqPwefzmEIaAbw95mKiLFNRIjGuFG5+cS76Q8/1HthRI0B5rSsjQBE YSinM4pk21tSfCAuYOjpeJ6rrg== X-Received: by 2002:a17:902:3c5:: with SMTP id d63-v6mr11812664pld.163.1526346168157; Mon, 14 May 2018 18:02:48 -0700 (PDT) Received: from localhost ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id c3-v6sm18890025pfn.62.2018.05.14.18.02.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 May 2018 18:02:47 -0700 (PDT) Date: Mon, 14 May 2018 18:02:47 -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 8/8] rcu: Fix cpustart tracepoint gp_seq number Message-ID: <20180515010247.GG209519@joelaf.mtv.corp.google.com> References: <20180514031541.67247-1-joel@joelfernandes.org> <20180514031541.67247-9-joel@joelfernandes.org> <20180514203320.GK26088@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180514203320.GK26088@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 01:33:20PM -0700, Paul E. McKenney wrote: > On Sun, May 13, 2018 at 08:15:41PM -0700, Joel Fernandes (Google) wrote: > > cpustart shows a stale gp_seq. This is because rdp->gp_seq is updated > > only at the end of the __note_gp_changes function. For this reason, use > > rnp->gp_seq instead. I believe we can't update rdp->gp_seq too early so > > lets just use the gp_seq from rnp instead. > > > > Signed-off-by: Joel Fernandes (Google) > > I took this one with the usual commit-log update. Please take a look! Looks good, thanks! - Joel > > Thanx, Paul > > ------------------------------------------------------------------------ > > commit 3e14c6a5225d201776edd9a96d9c9b4435855446 > Author: Joel Fernandes (Google) > Date: Sun May 13 20:15:41 2018 -0700 > > rcu: Fix cpustart tracepoint gp_seq number > > The "cpustart" trace event shows a stale gp_seq. This is because it uses > rdp->gp_seq, which is updated only at the end of the __note_gp_changes() > function. This commit therefore instead uses rnp->gp_seq. > > An alternative fix would be to update rdp->gp_seq earlier, but this would > break RCU's detection of the beginning of a new-to-this-CPU grace period. > > 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 de6447dd73de..23b855f5c5cb 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -1796,7 +1796,7 @@ static bool __note_gp_changes(struct rcu_state *rsp, struct rcu_node *rnp, > * set up to detect a quiescent state, otherwise don't > * go looking for one. > */ > - trace_rcu_grace_period(rsp->name, rdp->gp_seq, TPS("cpustart")); > + trace_rcu_grace_period(rsp->name, rnp->gp_seq, TPS("cpustart")); > need_gp = !!(rnp->qsmask & rdp->grpmask); > rdp->cpu_no_qs.b.norm = need_gp; > rdp->rcu_qs_ctr_snap = __this_cpu_read(rcu_dynticks.rcu_qs_ctr); >