]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cpuset: refactor cpus_allowed_validate_change
authorChen Ridong <chenridong@huawei.com>
Wed, 17 Sep 2025 06:04:51 +0000 (06:04 +0000)
committerTejun Heo <tj@kernel.org>
Wed, 17 Sep 2025 18:37:31 +0000 (08:37 -1000)
commitc6366739804f836ac88474527430d3fd174580eb
tree38ba0325b8a5a2a947262c1a8dc4ff43642ca51c
parent7e05981ba34a214fd43a2e4d776bc6b0c235e2fb
cpuset: refactor cpus_allowed_validate_change

Refactor cpus_allowed_validate_change to handle the special case where
cpuset.cpus can be set even when violating partition sibling CPU
exclusivity rules. This differs from the general validation logic in
validate_change. Add a wrapper function to properly handle this
exceptional case.

The trialcs->prs_err field is cleared before performing validation checks
for both CPU changes and partition errors. If cpus_allowed_validate_change
fails its validation, trialcs->prs_err is set to PERR_NOTEXCL. If partition
validation fails, the specific error code returned by validate_partition
is assigned to trialcs->prs_err.

With the partition validation status now directly available through
trialcs->prs_err, the local boolean variable 'invalidate' becomes
redundant and can be safely removed.

Signed-off-by: Chen Ridong <chenridong@huawei.com>
Reviewed-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cpuset.c