Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4809535imm; Mon, 14 May 2018 13:32:41 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrf+k/FLhMXNW7guXe4kS9+9WSfOJgczAPxHSCgM3ZCaoIbFW7xQz+CX/ZlmPFpbwyk23Bu X-Received: by 2002:a17:902:f83:: with SMTP id 3-v6mr11242004plz.336.1526329961098; Mon, 14 May 2018 13:32:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526329961; cv=none; d=google.com; s=arc-20160816; b=yc1QZEhEEiE5aqvFSP6qg6GqnxxG7VL7dlfk3px0ZrrpQh1wuAd2dKZPifWxf88jXH wKGC2myMnC1BCA6UsYUOUF9UqLQWrORgAjS6OsDnIpfh7lSeMbDXlSi8u6Ffl8NQ+qym rhtfbCBiGzRBsp0uXU2VZWyZHsICgNiAEsCh35n6ef4nGjb9GWK6embKnuc47x2/BHYh 2BeK7waZQ9l3U5qlZGbIagWbvaUGZvN3NKNQe3VO7WnK9kSGrv4Fx2y+IzKxHW036D1E w/3zFyU/M03ND5pm8XIkErijFKVNpprWrjg/ENEJ0xPezHxwe8hQczd/ASo/ikRmUpmt rCKw== 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=skxw5hcwgkX4xNAui1Bb48uqwQXcDi7QlnKV2GzjsCs=; b=zh+czzcRfuLA3nxa5a6y4ch+rsA0xG2XdpelcJn2FAtR9YU/BhoH9sLXEMg7OkEPGv geGhdKeI0TXVbrqB3tYvaAx3Dhz8Y/OjlumlrhAnamK6s+AM2Pcy7Tej5HWyho5IXjFF 4D+zE322D+H9ZVTcebCTSrJOK5fnT2Vdr445ESOGWi/wKutFRKlcxZ9uflf0j8dn7pfd o2nj6+71uHFACzvl/93ipzCsk7LJqrskbLLdQgzFSBaOQGMtIgtwLbMcYVoV7PeK/MyV Ep55xoetkpysKlE815OvVykXpLoTryKaiH7pVWa2cKVd1I249iOXDSwUj9Ta1w4fVaon j6Cw== 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 a21-v6si8475910pgd.97.2018.05.14.13.32.27; Mon, 14 May 2018 13:32:41 -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 S1752131AbeENUbz (ORCPT + 99 others); Mon, 14 May 2018 16:31:55 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:50632 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751865AbeENUby (ORCPT ); Mon, 14 May 2018 16:31:54 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4EKTwjC034560 for ; Mon, 14 May 2018 16:31:53 -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 2hygd6tmau-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 14 May 2018 16:31:53 -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 16:31:53 -0400 Received: from b01cxnp23033.gho.pok.ibm.com (9.57.198.28) by e11.ny.us.ibm.com (146.89.104.198) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 14 May 2018 16:31:49 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4EKVnTM1442288; Mon, 14 May 2018 20:31:49 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 05E1FB204D; Mon, 14 May 2018 17:33:47 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.108]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id C2246B2046; Mon, 14 May 2018 17:33:46 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 67F7C16C3731; Mon, 14 May 2018 13:33:20 -0700 (PDT) Date: Mon, 14 May 2018 13:33:20 -0700 From: "Paul E. McKenney" To: "Joel Fernandes (Google)" 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 Reply-To: paulmck@linux.vnet.ibm.com References: <20180514031541.67247-1-joel@joelfernandes.org> <20180514031541.67247-9-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180514031541.67247-9-joel@joelfernandes.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18051420-2213-0000-0000-000002A53301 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009025; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000260; SDB=6.01032323; UDB=6.00527748; IPR=6.00811454; MB=3.00021111; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-14 20:31:51 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18051420-2214-0000-0000-00005A1E4D69 Message-Id: <20180514203320.GK26088@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-14_05:,, 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-1805140206 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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! 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);