[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251025064844.495525-9-chenridong@huaweicloud.com>
Date: Sat, 25 Oct 2025 06:48:30 +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 RFC v2 08/22] 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 | 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
Powered by blists - more mailing lists