Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1039042imm; Wed, 23 May 2018 09:17:58 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo6lcQPod6tOF/3mzLac4SRgp2z0gOGOnylzZW8ypLLrtiLBGRSyWEJPpg9L6U7264qUKHG X-Received: by 2002:a65:408c:: with SMTP id t12-v6mr2875553pgp.222.1527092278896; Wed, 23 May 2018 09:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527092278; cv=none; d=google.com; s=arc-20160816; b=uA+Q2P4KX+lYY9ItVoPaWnaHyPKYd4nVf9wg6kv+1iBHjZS/dHjXUFzmbdJDhs61w+ 28ghU0Z2Md0jT3UrpcdgR21AHG4cCT7Brs6xxCt5jQ5K2gol9DCToESJzSPRMw7+T6te xkWu/CbEalQJw9phyfhFZJjNghDfpix+N3kWsKqB7N7gHX2zS7wmcPOLZ5m1L/QWnwWv 9gdVE4NhdryhfR0awEuTT78NDEhJnz8+04CXPp07Q9Ed5pbJqgHbwtwK1WRGeFOqUBA6 wKE9viTTDWOK6DewGGoQsKB93gXvAXuF0Ui1h/daUH+Jd+WNN6lG4CWS2jY12A+pugml Y3ig== 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=PY8B7wFKWZjKIdML5h8pgXygnJcwsR0AWQIFyYDbwDo=; b=qoIO5m4Jwp7EbefZRxJdtaGWwkBoOq3KTbFjwnmgcVCTNAMRIrpRPLPHhkUPBacQbJ xVMJKM19vFErt1kCSb9T/67nUSyqILg4a/Hmvuj/q72ITZTW/CHBh8tZVzDqylI678Hy sgjdaLBzYGzgMUHGOYHX2nDrguQp3lLapisvBd54IM77C5ofEarrRKqmebjICRkwHK9T VnaXtYneVDKQGv731UE53xEKx2Mi77LhRJrLfuuG5OQ17h4Z/rE5WWIfzeHeTHgYvIpO rxeCDPGl1aXp2l1h7pFbv/KkwtmWUCye3FYwxMg93B5vD9rERaW7pT1398VgFbi8dg2t LJww== 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 m39-v6si19155811plg.371.2018.05.23.09.17.44; Wed, 23 May 2018 09:17: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; 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 S1754726AbeEWQQ2 (ORCPT + 99 others); Wed, 23 May 2018 12:16:28 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:59774 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751646AbeEWQQ0 (ORCPT ); Wed, 23 May 2018 12:16:26 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4NGEGov139734 for ; Wed, 23 May 2018 12:16:25 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0a-001b2d01.pphosted.com with ESMTP id 2j58rvj6xe-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 23 May 2018 12:16:24 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 23 May 2018 10:16:23 -0600 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 23 May 2018 10:16:18 -0600 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4NG52HU52166684 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 23 May 2018 16:05:02 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0E640B2064; Wed, 23 May 2018 13:06:51 -0400 (EDT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E3EB6B205F; Wed, 23 May 2018 13:06:50 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.108]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 23 May 2018 13:06:50 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id B8F1516C5DD2; Wed, 23 May 2018 09:06:40 -0700 (PDT) Date: Wed, 23 May 2018 09:06:40 -0700 From: "Paul E. McKenney" To: Joel Fernandes Cc: linux-kernel@vger.kernel.org, "Joel Fernandes (Google)" , Boqun Feng , byungchul.park@lge.com, Ingo Molnar , Josh Triplett , kernel-team@android.com, Lai Jiangshan , Mathieu Desnoyers , Peter Zilstra , Steven Rostedt Subject: Re: [PATCH 4/4] rcu: Identify grace period is in progress as we advance up the tree Reply-To: paulmck@linux.vnet.ibm.com References: <20180523063815.198302-1-joel@joelfernandes.org> <20180523063815.198302-5-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180523063815.198302-5-joel@joelfernandes.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18052316-0012-0000-0000-0000164BF96F X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009072; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000261; SDB=6.01036558; UDB=6.00530282; IPR=6.00815685; MB=3.00021260; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-23 16:16:22 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18052316-0013-0000-0000-000052E8672F Message-Id: <20180523160640.GN3803@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-23_06:,, 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-1805230160 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 22, 2018 at 11:38:15PM -0700, Joel Fernandes wrote: > From: "Joel Fernandes (Google)" > > There's no need to keep checking the same starting node for whether a > grace period is in progress as we advance up the funnel lock loop. Its > sufficient if we just checked it in the start, and then subsequently > checked the internal nodes as we advanced up the combining tree. This > also makes sense because the grace-period updates propogate from the > root to the leaf, so there's a chance we may find a grace period has > started as we advance up, lets check for the same. > > Reported-by: Paul McKenney > Signed-off-by: Joel Fernandes (Google) Looks good, queued for further review and testing, thank you! Thanx, Paul > --- > kernel/rcu/tree.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > index 31f4b4b7d824..65e49282429c 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -1570,11 +1570,12 @@ static bool rcu_start_this_gp(struct rcu_node *rnp_start, struct rcu_data *rdp, > goto unlock_out; > } > rnp->gp_seq_needed = gp_seq_req; > - if (rcu_seq_state(rcu_seq_current(&rnp_start->gp_seq))) { > + if (rcu_seq_state(rcu_seq_current(&rnp->gp_seq))) { > /* > - * We just marked the leaf, and a grace period > - * is in progress, which means that rcu_gp_cleanup() > - * will see the marking. Bail to reduce contention. > + * We just marked the leaf or internal node, and a > + * grace period is in progress, which means that > + * rcu_gp_cleanup() will see the marking. Bail to > + * reduce contention. > */ > trace_rcu_this_gp(rnp_start, rdp, gp_seq_req, > TPS("Startedleaf")); > -- > 2.17.0.441.gb46fe60e1d-goog >