From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A7222C0F8F; Sat, 25 Oct 2025 07:03:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761375834; cv=none; b=tvVdzjw8yFPl+hyqGaTKEyeA4Ju2FkamD+SMJc7GneSpeJZJTJpRqkwwaTQBjc2jLTuZA8rOWuhe+MJ30YblTMHpI0pD8vecs2OH+9HPe9jI6d78BxXCcqORT7eDVv5CmTy2hveAYDpHzTixc5/tTWO2fZQOypxF0R6ztA5w/SU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761375834; c=relaxed/simple; bh=z/FuJIjISU5j5sPDMZ7JaOuIc2RoGP0TaWr5sWNIoxM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YbRZrS8ZR9qrbEjNor0hgA5BdolnJ/6WT/weOREmYaJkJ3z3XxHlL1iF2xG2SsrQ17Vju1K0+RbAIZWRgmXGEXfdcjb8z471tzSkAUxAP75oQAQB7HP4unRCrIxDOBsyOJJnxvgeR6FodXYRX4Z34z19kn+rigzzObAavGSX0E8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTPS id 4ctrM62wYfzKHMYT; Sat, 25 Oct 2025 15:02:58 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id 525871A0359; Sat, 25 Oct 2025 15:03:50 +0800 (CST) Received: from hulk-vt.huawei.com (unknown [10.67.174.121]) by APP2 (Coremail) with SMTP id Syh0CgCHKUJGdvxovSssBg--.49460S10; Sat, 25 Oct 2025 15:03:50 +0800 (CST) From: Chen Ridong To: longman@redhat.com, tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, lujialin4@huawei.com, chenridong@huawei.com Subject: [PATCH RFC v2 08/22] cpuset: use partition_disable() for remote partition disablement Date: Sat, 25 Oct 2025 06:48:30 +0000 Message-Id: <20251025064844.495525-9-chenridong@huaweicloud.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251025064844.495525-1-chenridong@huaweicloud.com> References: <20251025064844.495525-1-chenridong@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:Syh0CgCHKUJGdvxovSssBg--.49460S10 X-Coremail-Antispam: 1UD129KBjvJXoW7WrWxCFyxJr48Gw4xtF15CFg_yoW8AF1rpF nxCrW7KFW5XF15uasrtFnFgw1rKa1DXa9rt3srWryfXFy7Aa4vka4jk39Yv34UXFyDW345 Z3Z09rWjqF12ywUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBYb4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUAV Cq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0 rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2Ix0cI8IcVCY1x0267 AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E 14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7 xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Y z7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lc7CjxVAaw2AFwI0_JF0_Jw1l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x 0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU1l_M7UUUUU== X-CM-SenderInfo: hfkh02xlgr0w46kxt4xhlfz01xgou0bp/ From: Chen Ridong Now that the partition_disable() helper is available, replace the existing implementation for remote partition disablement with this centralized function to unify the disablement logic. Signed-off-by: Chen Ridong --- kernel/cgroup/cpuset.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index ee1140cf45b9..7577e9134094 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -1754,27 +1754,13 @@ static int remote_partition_enable(struct cpuset *cs, int new_prs, */ static void remote_partition_disable(struct cpuset *cs, struct tmpmasks *tmp) { - bool isolcpus_updated; + int new_prs; WARN_ON_ONCE(!is_remote_partition(cs)); WARN_ON_ONCE(!cpumask_subset(cs->effective_xcpus, subpartitions_cpus)); - spin_lock_irq(&callback_lock); - list_del_init(&cs->remote_sibling); - isolcpus_updated = partition_xcpus_del(cs->partition_root_state, - NULL, cs->effective_xcpus); - if (cs->prs_err) - cs->partition_root_state = -cs->partition_root_state; - else - cs->partition_root_state = PRS_MEMBER; - - /* effective_xcpus may need to be changed */ - compute_excpus(cs, cs->effective_xcpus); - reset_partition_data(cs); - spin_unlock_irq(&callback_lock); - update_unbound_workqueue_cpumask(isolcpus_updated); - cpuset_force_rebuild(); - + new_prs = cs->prs_err ? -cs->partition_root_state : PRS_MEMBER; + partition_disable(cs, NULL, new_prs, cs->prs_err); /* * Propagate changes in top_cpuset's effective_cpus down the hierarchy. */ -- 2.34.1