Re: [PATCH -next RFC 07/11] cpuset: refactor out invalidate_cs_partition

From: Waiman Long
Date: Fri Aug 29 2025 - 15:57:01 EST



On 8/28/25 8:56 AM, Chen Ridong wrote:
From: Chen Ridong <chenridong@xxxxxxxxxx>

Refactor the invalidate_cs_partition function to handle cpuset partition
invalidation when modifying cpuset.cpus. This refactoring also makes the
function reusable for handling cpuset.cpus.exclusive updates in subsequent
patches.

Signed-off-by: Chen Ridong <chenridong@xxxxxxxxxx>
---
kernel/cgroup/cpuset.c | 49 +++++++++++++++++++++++++++++++-----------
1 file changed, 36 insertions(+), 13 deletions(-)

diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 5cfc53fe717c..71190f142700 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -2376,6 +2376,40 @@ static int parse_cpulist(const char *buf, struct cpumask *out_mask)
return 0;
}
+/**
+ * invalidate_cs_partition - Validate and mark the validity of a cpuset partition configuration

The function name has "invalidate", but the description uses validate. It is confusing.

My suggestion

  validate_partition - Check the validity of a cpuset partition configuration

  Return 0 if valid, a non-zero prs_errcode otherwise

Cheers,
Longman