Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4523957pxa; Mon, 10 Aug 2020 11:08:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkhUDgvdenrBetLZ6ruCQfyfkQuC62S3i37mLWM8TkfBV97TJDloiG3RKV7p+UaeqeJfzz X-Received: by 2002:a17:906:7752:: with SMTP id o18mr22110839ejn.150.1597082891265; Mon, 10 Aug 2020 11:08:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597082891; cv=none; d=google.com; s=arc-20160816; b=S8ju4+8yuFBf26n+cGvuoC+vH5pUko9g5IqrahwxHKN4UZSPGT4tFm1ZeTHpT3div2 j51n27fvWz2C6bBViOVkRj7/ieGAEEZxWYVZcaL+JcHbxkDKeNZCQBaZgWJXS4mq0nrG tfrmybefRapYsWiOduB1889l9cjoB9QpjMwXJy7kLZO3miM7CkXrhIld3vTaKJKEgElU SFJzR5NP8NmSDx1aTA5kU+tEwrG2tLd0T7Nvx14PEjbykdCb2ld/9q8IhU22HfrSASK6 gern49IFgXfdsgwyL/hSEEInkCCYKn8aqDxjTenzehOUvIxokJlX1uV3dP0wlwRfx6TW ki6g== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=nP1oN/cF/DUtGYr3zEYL/7AjGWLXtAFrsp/60Br4QQ4=; b=Dh1e4nFSp17y2W/AR8B4ZX/acAjJ6XPzniXrJ30P8e7V9wadWyMNzFxElEQFT24w4Y 8SFHEyrLGR8rlue33GEkkZek7pGdoloHm6yBmORMm1LWMld9hBcYKY3NN+26Rfbk8COy BMNN6IaH3un8ocuLCmzvep+ND9GZL1l5TTwgtQjocs96sCZMVuwAQSMAv+rwWVjYVsWF Vvy36zSNI6LqK1oKiCLAvFou48bx+r5HXJYpHwhIHU1usGX68ZzxTLvnJmSwmdqiV8jp 1AUSax4MfrK25iW2p3Ezoj6FUMxwDJKD/5RFGNVqbAXAz3MEw6SvQ427FhM13l6Ps2NU 8Deg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0ARIYGRr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bd20si6557037edb.217.2020.08.10.11.07.48; Mon, 10 Aug 2020 11:08:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0ARIYGRr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728074AbgHJSGu (ORCPT + 99 others); Mon, 10 Aug 2020 14:06:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:47148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728050AbgHJSGt (ORCPT ); Mon, 10 Aug 2020 14:06:49 -0400 Received: from paulmck-ThinkPad-P72.home (unknown [50.45.173.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 468B82080C; Mon, 10 Aug 2020 18:06:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597082808; bh=skTlBedsUdXXwu9qhOnpSxT61c1G3PJ8Hnx8e7a0Hjs=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=0ARIYGRrgnTHwYQhxwiFRe5qenPjQcsrzk/QazsEeJ/eG8JKtZ+FwqQzdMRlr/vHK VmqdD2rQBPk5aEDjGbC0sw2Gmdkafz9YXdDU9i4mGSdR2ily3vVKB3hPtzc9y1WEYT M9GYTZtEq6WEEdZROLE0uhCkXFHaf+WdH/wfKm3g= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id E7BB235228C7; Mon, 10 Aug 2020 11:06:47 -0700 (PDT) Date: Mon, 10 Aug 2020 11:06:47 -0700 From: "Paul E. McKenney" To: "Joel Fernandes (Google)" Cc: linux-kernel@vger.kernel.org, Davidlohr Bueso , Jonathan Corbet , Josh Triplett , Lai Jiangshan , linux-doc@vger.kernel.org, Mathieu Desnoyers , Mauro Carvalho Chehab , neeraju@codeaurora.org, peterz@infradead.org, Randy Dunlap , rcu@vger.kernel.org, Steven Rostedt , tglx@linutronix.de, vineethrp@gmail.com Subject: Re: [PATCH v4 2/5] rcu/tree: Clarify comments about FQS loop reporting quiescent states Message-ID: <20200810180647.GN4295@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200807170722.2897328-1-joel@joelfernandes.org> <20200807170722.2897328-3-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200807170722.2897328-3-joel@joelfernandes.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 07, 2020 at 01:07:19PM -0400, Joel Fernandes (Google) wrote: > At least since v4.19, the FQS loop no longer reports quiescent states > for offline CPUs unless it is an emergency. > > This commit therefore fixes the comment in rcu_gp_init() to match the > current code. > > Signed-off-by: Joel Fernandes (Google) > --- > kernel/rcu/tree.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > index a49fa3b60faa..2fb66cdbfa25 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -1701,9 +1701,11 @@ static bool rcu_gp_init(void) > > /* > * Apply per-leaf buffered online and offline operations to the > - * rcu_node tree. Note that this new grace period need not wait > - * for subsequent online CPUs, and that quiescent-state forcing > - * will handle subsequent offline CPUs. > + * rcu_node tree. Note that this new grace period need not wait for > + * subsequent online CPUs, and that RCU hooks in the CPU offlining > + * path, when combined with checks in this function, will handle CPUs > + * that are currently going offline or that go offline later. Refer to > + * RCU's Requirements documentation about hotplug requirements as well. > */ > rcu_state.gp_state = RCU_GP_ONOFF; > rcu_for_each_leaf_node(rnp) { Very good! I pulled this in with light edits as shown below. Please let me know if I messed something up. Thanx, Paul ------------------------------------------------------------------------ commit a6117399840b963f90cc5322ef9ea7c52de639b2 Author: Joel Fernandes (Google) Date: Fri Aug 7 13:07:19 2020 -0400 rcu/tree: Clarify comments about FQS loop reporting quiescent states Since at least v4.19, the FQS loop no longer reports quiescent states for offline CPUs except in emergency situations. This commit therefore fixes the comment in rcu_gp_init() to match the current code. 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 bcc6160..59e1943 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -1730,10 +1730,13 @@ static bool rcu_gp_init(void) raw_spin_unlock_irq_rcu_node(rnp); /* - * Apply per-leaf buffered online and offline operations to the - * rcu_node tree. Note that this new grace period need not wait - * for subsequent online CPUs, and that quiescent-state forcing - * will handle subsequent offline CPUs. + * Apply per-leaf buffered online and offline operations to + * the rcu_node tree. Note that this new grace period need not + * wait for subsequent online CPUs, and that RCU hooks in the CPU + * offlining path, when combined with checks in this function, + * will handle CPUs that are currently going offline or that will + * go offline later. Please also refer to "Hotplug CPU" section + * of RCU's Requirements documentation. */ rcu_state.gp_state = RCU_GP_ONOFF; rcu_for_each_leaf_node(rnp) {