Linux cgroups development
 help / color / mirror / Atom feed
* [PATCH -next RFC -v2 00/11] Refactor cpus mask setting
@ 2025-09-09  3:32 Chen Ridong
  2025-09-09  3:32 ` [PATCH -next RFC -v2 01/11] cpuset: move the root cpuset write check earlier Chen Ridong
                   ` (11 more replies)
  0 siblings, 12 replies; 27+ messages in thread
From: Chen Ridong @ 2025-09-09  3:32 UTC (permalink / raw)
  To: longman, tj, hannes, mkoutny; +Cc: cgroups, linux-kernel, lujialin4, chenridong

From: Chen Ridong <chenridong@huawei.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 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: refactor partition_cpus_change
  cpuset: use parse_cpulist for setting cpus.exclusive
  cpuset: use partition_cpus_change for setting exclusive cpus

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

-- 
2.34.1


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2025-09-16  8:02 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-09  3:32 [PATCH -next RFC -v2 00/11] Refactor cpus mask setting Chen Ridong
2025-09-09  3:32 ` [PATCH -next RFC -v2 01/11] cpuset: move the root cpuset write check earlier Chen Ridong
2025-09-15 18:43   ` Waiman Long
2025-09-09  3:32 ` [PATCH -next RFC -v2 02/11] cpuset: remove unused assignment to trialcs->partition_root_state Chen Ridong
2025-09-15 18:44   ` Waiman Long
2025-09-09  3:32 ` [PATCH -next RFC -v2 03/11] cpuset: change return type of is_partition_[in]valid to bool Chen Ridong
2025-09-15 18:44   ` Waiman Long
2025-09-09  3:32 ` [PATCH -next RFC -v2 04/11] cpuset: Refactor exclusive CPU mask computation logic Chen Ridong
2025-09-15 18:47   ` Waiman Long
2025-09-09  3:32 ` [PATCH -next RFC -v2 05/11] cpuset: refactor CPU mask buffer parsing logic Chen Ridong
2025-09-15 18:49   ` Waiman Long
2025-09-09  3:32 ` [PATCH -next RFC -v2 06/11] cpuset: introduce cpus_excl_conflict and mems_excl_conflict helpers Chen Ridong
2025-09-15 18:42   ` Waiman Long
2025-09-16  7:59     ` Chen Ridong
2025-09-09  3:32 ` [PATCH -next RFC -v2 07/11] cpuset: refactor out validate_partition Chen Ridong
2025-09-15 18:53   ` Waiman Long
2025-09-09  3:32 ` [PATCH -next RFC -v2 08/11] cpuset: refactor cpus_allowed_validate_change Chen Ridong
2025-09-15 19:05   ` Waiman Long
2025-09-09  3:32 ` [PATCH -next RFC -v2 09/11] cpuset: refactor partition_cpus_change Chen Ridong
2025-09-15 19:34   ` Waiman Long
2025-09-16  8:01     ` Chen Ridong
2025-09-09  3:32 ` [PATCH -next RFC -v2 10/11] cpuset: use parse_cpulist for setting cpus.exclusive Chen Ridong
2025-09-15 19:39   ` Waiman Long
2025-09-09  3:32 ` [PATCH -next RFC -v2 11/11] cpuset: use partition_cpus_change for setting exclusive cpus Chen Ridong
2025-09-15 20:05   ` Waiman Long
2025-09-16  8:02     ` Chen Ridong
2025-09-15 11:18 ` [PATCH -next RFC -v2 00/11] Refactor cpus mask setting Chen Ridong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox