From patchwork Thu Jan 5 00:23:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 13089238 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAD28C54E76 for ; Thu, 5 Jan 2023 00:23:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240151AbjAEAXg (ORCPT ); Wed, 4 Jan 2023 19:23:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235537AbjAEAXQ (ORCPT ); Wed, 4 Jan 2023 19:23:16 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE2E74435E; Wed, 4 Jan 2023 16:23:13 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8A06EB8198A; Thu, 5 Jan 2023 00:23:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22A1CC433A7; Thu, 5 Jan 2023 00:23:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672878188; bh=Zj66HaKlbW7or4kBjbwXaM4/EWUfv7i59XPipGrmdK0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ulKYLo2ZelNq3JjSgOVb1UmueUei/z6vfdW5xa/K9HlH5Rsqxsctdb4/Tujqz4bh/ SLYLIFY/7LXH42rZs2DBm8dPtZ1qhcWCwxzBEygxCyfmvOdrUWWi0K5bldjYXGM4+E A9qGjQEKRNTZ8DR0SNwMy2p6ZCtRikhj613LcOEgJZs0oF7I4zuX7AzlLz0qOQKgTv HHus1peh8fjC+fXpJ/m3aPrcp1+8W+GvMdwq4JY1CdjHAejq388N7yzHmDMQp0FWMQ poja+Oartem/2us8mYOzK07V7SCE79MquyoyOJ7/B4JcXdza+m7UNi7/wbrns8bgin VY5gly0yNjKFw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 84A6B5C1C64; Wed, 4 Jan 2023 16:23:07 -0800 (PST) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, Zqiang , "Paul E . McKenney" Subject: [PATCH rcu 10/10] rcu: Remove redundant call to rcu_boost_kthread_setaffinity() Date: Wed, 4 Jan 2023 16:23:05 -0800 Message-Id: <20230105002305.1768591-10-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20230105002257.GA1768487@paulmck-ThinkPad-P17-Gen-1> References: <20230105002257.GA1768487@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: rcu@vger.kernel.org From: Zqiang The rcu_boost_kthread_setaffinity() function is invoked at rcutree_online_cpu() and rcutree_offline_cpu() time, early in the online timeline and late in the offline timeline, respectively. It is also invoked from rcutree_dead_cpu(), however, in the absence of userspace manipulations (for which userspace must take responsibility), this call is redundant with that from rcutree_offline_cpu(). This redundancy can be demonstrated by printing out the relevant cpumasks This commit therefore removes the call to rcu_boost_kthread_setaffinity() from rcutree_dead_cpu(). Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney --- kernel/rcu/tree.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 80b84ae285b41..89313c7c17b62 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -4076,15 +4076,10 @@ static void rcu_cleanup_dead_rnp(struct rcu_node *rnp_leaf) */ int rcutree_dead_cpu(unsigned int cpu) { - struct rcu_data *rdp = per_cpu_ptr(&rcu_data, cpu); - struct rcu_node *rnp = rdp->mynode; /* Outgoing CPU's rdp & rnp. */ - if (!IS_ENABLED(CONFIG_HOTPLUG_CPU)) return 0; WRITE_ONCE(rcu_state.n_online_cpus, rcu_state.n_online_cpus - 1); - /* Adjust any no-longer-needed kthreads. */ - rcu_boost_kthread_setaffinity(rnp, -1); // Stop-machine done, so allow nohz_full to disable tick. tick_dep_clear(TICK_DEP_BIT_RCU); return 0;