Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2630066rdb; Fri, 8 Dec 2023 14:07:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IGN2r6QJ/0fXqLq3kAE1hwk7k9x5dF3ekdUW7G5gVvEAUP9+z1en8itFa7wziyYxjHmVFYi X-Received: by 2002:a17:90b:1915:b0:286:bcbd:b875 with SMTP id mp21-20020a17090b191500b00286bcbdb875mr726160pjb.63.1702073226357; Fri, 08 Dec 2023 14:07:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702073226; cv=none; d=google.com; s=arc-20160816; b=Vp0ddtBAcfJ7sy8KOdZbiIJTtk3nhj/sK3ECkWYiCeZrSahfRbHkbu2evRbXKmYEVb icSywr3gQxi1tP8fQ0RwfQdFx+wYfe/x1/VpiUvu7YyqkU+sPaQ9RY963AWgZjGb+Znv EpWWsVR78K73+OLt0n+Qh85EHA8PwY0On/mbKR8NMlJH8tn2M+T6BI8f5iq2KiU/S4O0 bLaSgI9bpc2d80g1AVWM3t5XRa/6iyuK25OZ3kRoKAW2qf211S3PlsdqrWnMZ7VI4S4d FJNOyWctBc1rt9hLfiUq9HurULD2CSb0r2YavqN+eJxD4Lseg/OT4R4/UBkPHv3j4+XZ yP0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Y2sZ+Nzc5TiMVmg3ajbIW4sHf7mTTrsafqJY8u9+TlY=; fh=oQYyamNNPu+olgCSRq+hbX8YB7X4Nkc8CF7lh4c2TlE=; b=p8+eqZTotlnJpqCcrd6CO1PW+xT2FFv93ZaPjvFcUfqmojRjUmj2mJnMiyIDjWALPr tMz8TznjEHFb1lVT3P+SkXZXLzuEaU9K9MKJ8Nk+es6M30/dNi18tmFYawCpyj1c+QvB gJF0rd2xVc2DzEpvza/4jVOwWyW12z9D3IHvuUVKCGmG8UjrmQIVCzYOqk7E0DqZlpos WsHKFhWDd6c2FTv0DDZpRDOq73sRFViisY8JtIsB3zRDPMZQCrjZ6VgC5ueH5GpD/oxH NT5Jd8A2L7tA9C/xdGNYGknBbCnTbb01iO92+Jztr98B1wrH/qBy3qMKkPIT+Ct/UbMv oNsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=p9mX3ajP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id w11-20020a17090abc0b00b002886d99b09csi3512199pjr.73.2023.12.08.14.07.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 14:07:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=p9mX3ajP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 079FF84D5EAD; Fri, 8 Dec 2023 14:07:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574911AbjLHWGY (ORCPT + 99 others); Fri, 8 Dec 2023 17:06:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1574908AbjLHWGB (ORCPT ); Fri, 8 Dec 2023 17:06:01 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 839D210E0 for ; Fri, 8 Dec 2023 14:06:07 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9066C433CA; Fri, 8 Dec 2023 22:06:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702073167; bh=yWebujIG4HSorgdJi4M3lUUuBe+hsvsBv+UYBWpi03o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p9mX3ajPq8YULvimHUvR6KN5ezjGUnX5P3BFYLS3YyCehL1VtWGV705VErfOiqhdj 83TJ5wXcahka4lu7FykluPIc2eMRrgnuA4nfuXuam3jdhKyXOcg4PO7LYNtJF2N0hG 84uR1qF51GWYppty8R1UFYywgyxgWON2AnUWu5HjdqI96nMlCsrBZn5REKeriurL2p 84Rhf5qVjgnnIiynDaMaM6kAiE5hQlHumfu7vaYRKcgu04PV+USxKeWNemMDRCBhpz 8L12JkJGnXg/O9cPQTedeJFC8ymzxvtPSDWPCO8LEUTn0v+409vJFdc/9SVj298Czh ac7QIUKTOUMpg== From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Boqun Feng , Joel Fernandes , Neeraj Upadhyay , "Paul E . McKenney" , Uladzislau Rezki , Zqiang , rcu , Anna-Maria Behnsen , Thomas Gleixner Subject: [PATCH 5/8] rcu: s/boost_kthread_mutex/kthread_mutex Date: Fri, 8 Dec 2023 23:05:42 +0100 Message-ID: <20231208220545.7452-6-frederic@kernel.org> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231208220545.7452-1-frederic@kernel.org> References: <20231208220545.7452-1-frederic@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 08 Dec 2023 14:07:00 -0800 (PST) This mutex currently protecting per node boost kthreads creation and affinity setting across CPU hotplug operations will soon be used also for expedited kworkers. Generalize its name to prepare for that. Signed-off-by: Frederic Weisbecker --- kernel/rcu/tree.c | 2 +- kernel/rcu/tree.h | 2 +- kernel/rcu/tree_plugin.h | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 39679cf66c3a..996efaded5bf 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -4892,7 +4892,7 @@ static void __init rcu_init_one(void) init_waitqueue_head(&rnp->exp_wq[2]); init_waitqueue_head(&rnp->exp_wq[3]); spin_lock_init(&rnp->exp_lock); - mutex_init(&rnp->boost_kthread_mutex); + mutex_init(&rnp->kthread_mutex); raw_spin_lock_init(&rnp->exp_poll_lock); rnp->exp_seq_poll_rq = RCU_GET_STATE_COMPLETED; INIT_WORK(&rnp->exp_poll_wq, sync_rcu_do_polled_gp); diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h index e0e70b663cbf..f98a245e5f32 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h @@ -113,7 +113,7 @@ struct rcu_node { /* side effect, not as a lock. */ unsigned long boost_time; /* When to start boosting (jiffies). */ - struct mutex boost_kthread_mutex; + struct mutex kthread_mutex; /* Exclusion for thread spawning and affinity */ /* manipulation. */ struct task_struct *boost_kthread_task; diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 41021080ad25..0d307674915c 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -1195,7 +1195,7 @@ static void rcu_spawn_one_boost_kthread(struct rcu_node *rnp) struct sched_param sp; struct task_struct *t; - mutex_lock(&rnp->boost_kthread_mutex); + mutex_lock(&rnp->kthread_mutex); if (rnp->boost_kthread_task || !rcu_scheduler_fully_active) goto out; @@ -1212,7 +1212,7 @@ static void rcu_spawn_one_boost_kthread(struct rcu_node *rnp) wake_up_process(t); /* get to TASK_INTERRUPTIBLE quickly. */ out: - mutex_unlock(&rnp->boost_kthread_mutex); + mutex_unlock(&rnp->kthread_mutex); } /* @@ -1224,7 +1224,7 @@ static void rcu_spawn_one_boost_kthread(struct rcu_node *rnp) * no outgoing CPU. If there are no CPUs left in the affinity set, * this function allows the kthread to execute on any CPU. * - * Any future concurrent calls are serialized via ->boost_kthread_mutex. + * Any future concurrent calls are serialized via ->kthread_mutex. */ static void rcu_boost_kthread_setaffinity(struct rcu_node *rnp, int outgoingcpu) { @@ -1237,7 +1237,7 @@ static void rcu_boost_kthread_setaffinity(struct rcu_node *rnp, int outgoingcpu) return; if (!zalloc_cpumask_var(&cm, GFP_KERNEL)) return; - mutex_lock(&rnp->boost_kthread_mutex); + mutex_lock(&rnp->kthread_mutex); mask = rcu_rnp_online_cpus(rnp); for_each_leaf_node_possible_cpu(rnp, cpu) if ((mask & leaf_node_cpu_bit(rnp, cpu)) && @@ -1250,7 +1250,7 @@ static void rcu_boost_kthread_setaffinity(struct rcu_node *rnp, int outgoingcpu) cpumask_clear_cpu(outgoingcpu, cm); } set_cpus_allowed_ptr(t, cm); - mutex_unlock(&rnp->boost_kthread_mutex); + mutex_unlock(&rnp->kthread_mutex); free_cpumask_var(cm); } -- 2.42.1