[PATCH RFC v2 19/22] cpuset: use validate_local_partition in local_partition_enable
From: Chen Ridong
Date: Sat Oct 25 2025 - 03:05:42 EST
From: Chen Ridong <chenridong@xxxxxxxxxx>
Replace the partition error checks within `local_partition_enable()` by
utilizing the common `validate_local_partition()` function.
Signed-off-by: Chen Ridong <chenridong@xxxxxxxxxx>
---
kernel/cgroup/cpuset.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index fb1b332ee145..feb8413eaffa 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -1877,16 +1877,6 @@ static int local_partition_enable(struct cpuset *cs,
lockdep_assert_held(&cpuset_mutex);
WARN_ON_ONCE(is_remote_partition(cs)); /* For local partition only */
- /*
- * The parent must be a partition root.
- * The new cpumask, if present, or the current cpus_allowed must
- * not be empty.
- */
- if (!is_partition_valid(parent)) {
- return is_partition_invalid(parent)
- ? PERR_INVPARENT : PERR_NOTPART;
- }
-
/*
* Need to call compute_excpus() in case
* exclusive_cpus not set. Sibling conflict should only happen
@@ -1895,7 +1885,7 @@ static int local_partition_enable(struct cpuset *cs,
if (compute_excpus(cs, tmp->new_cpus))
WARN_ON_ONCE(!cpumask_empty(cs->exclusive_cpus));
- part_error = validate_partition(cs, new_prs, tmp->new_cpus);
+ part_error = validate_local_partition(cs, new_prs, tmp->new_cpus, false);
if (part_error)
return part_error;
--
2.34.1