lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250917060454.2885698-1-chenridong@huaweicloud.com>
Date: Wed, 17 Sep 2025 06:04:43 +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 00/11] Refactor cpus mask setting

From: Chen Ridong <chenridong@...wei.com>

This patch series refactors the CPU mask configuration logic for both
cpuset.cpus and cpuset.cpus.exclusive settings. The primary goal is to
improve code readability through comprehensive function restructuring.

The CPU mask update process follows these steps:
1. Parse user input
2. Skip processing if no actual change to CPU mask
3. Compute trial cpuset's effective exclusive CPUs
4. Validate changes and return error if invalid
5. Handle partition state changes resulting from CPU mask modifications
6. Apply new CPU mask to the cpuset
7. Propagate changes through the hierarchy

The series is organized as follows:
patches 1-3: Code cleanup and preparation for refactoring
patches 4-9: Refactoring of cpuset.cpus configuration logic
patches 10-11: Refactoring of cpuset.cpus.exclusive configuration logic

---

Changes from RFC v2:
- Patch 6: Fix commit message suggested-by Longman.
- Patch 9: Simplified assignment logic and revised commit message.
- Patch 11: Update the commit message suggested-by Longman.

Changes from v1:
- Patch 1: Use direct comparison (cs == &top_cpuset) instead of the
           cpuset_is_root() helper function
- Patch 6: Updated comments for better clarity
- Patch 7: Refactored validate_partition to replace the previous
           invalidate_cs_partition implementation
- Patch 8: Renamed acpus_validate_change to cpus_allowed_validate_change
- Patch 9: Updated commit message with more detailed information

Chen Ridong (11):
  cpuset: move the root cpuset write check earlier
  cpuset: remove unused assignment to trialcs->partition_root_state
  cpuset: change return type of is_partition_[in]valid to bool
  cpuset: Refactor exclusive CPU mask computation logic
  cpuset: refactor CPU mask buffer parsing logic
  cpuset: introduce cpus_excl_conflict and mems_excl_conflict helpers
  cpuset: refactor out validate_partition
  cpuset: refactor cpus_allowed_validate_change
  cpuset: introduce partition_cpus_change
  cpuset: use parse_cpulist for setting cpus.exclusive
  cpuset: use partition_cpus_change for setting exclusive cpus

 kernel/cgroup/cpuset.c | 449 ++++++++++++++++++++++-------------------
 1 file changed, 245 insertions(+), 204 deletions(-)

-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ