[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251117024627.1128037-8-chenridong@huaweicloud.com>
Date: Mon, 17 Nov 2025 02:46:13 +0000
From: Chen Ridong <chenridong@...weicloud.com>
To: longman@...hat.com,
tj@...nel.org,
hannes@...xchg.org,
mkoutny@...e.com
Cc: cgroups@...r.kernel.org,
linux-kernel@...r.kernel.org,
lujialin4@...wei.com,
chenridong@...wei.com
Subject: [PATCH -next 07/21] cpuset: use partition_disable() for remote partition disablement
From: Chen Ridong <chenridong@...wei.com>
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 <chenridong@...wei.com>
---
kernel/cgroup/cpuset.c | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 31c7b967c81d..1482c501a49c 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -1823,23 +1823,13 @@ static int remote_partition_enable(struct cpuset *cs, int new_prs,
*/
static void remote_partition_disable(struct cpuset *cs, struct tmpmasks *tmp)
{
+ 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);
- cs->remote_partition = false;
- 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_isolation_cpumasks();
- 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
Powered by blists - more mailing lists