The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH RFC v2 00/22] cpuset: rework local partition logic
@ 2025-10-25  6:48 Chen Ridong
  2025-10-25  6:48 ` [PATCH RFC v2 01/22] cpuset: fix isolcpus stay in root when isolated partition changes to root Chen Ridong
                   ` (22 more replies)
  0 siblings, 23 replies; 46+ messages in thread
From: Chen Ridong @ 2025-10-25  6:48 UTC (permalink / raw)
  To: longman, tj, hannes, mkoutny; +Cc: cgroups, linux-kernel, lujialin4, chenridong

From: Chen Ridong <chenridong@huawei.com>

The current local partition implementation consolidates all operations
(enable, disable, invalidate, and update) within the large
update_parent_effective_cpumask() function, which exceeds 300 lines.
This monolithic approach has become increasingly difficult to understand
and maintain. Additionally, partition-related fields are updated in
multiple locations, leading to redundant code and potential corner case
oversights.

This patch series refactors the local partition logic by separating
operations into dedicated functions: local_partition_enable(),
local_partition_disable(), and local_partition_update(), creating
symmetry with the existing remote partition infrastructure.

The series is organized as follows:

1. Fix a bug that isolcpus stat in root partition.

2. Infrastructure Preparation (Patches 2-3):
   - Code cleanup and preparation for the refactoring work

3. Introduce partition operation helpers (Patches 4-6):
   - Intoduce out partition_enable(), partition_disable(), and
     partition_update() functions.

4. Use new helpers for remote partition (Patches 7-9)

5. Local Partition Implementation (Patches 10-13):
   - Separate update_parent_effective_cpumask() into dedicated functions:
     * local_partition_enable()
     * local_partition_disable()
     * local_partition_invalidate()
     * local_partition_update()

6. Optimization and Cleanup (Patches 14-22):
   - Remove redundant partition-related operations
   - Additional optimizations based on the new architecture

---

Changes in v2:
- Added bugfix for root partition isolcpus at series start.
- Completed helper function implementations when first introduced.
- Split larger patches into smaller, more reviewable units.
- Incorporated feedback from Longman.

Chen Ridong (22):
  cpuset: fix isolcpus stay in root when isolated partition changes to
    root
  cpuset: add early empty cpumask check in partition_xcpus_add/del
  cpuset: generalize validate_partition() interface
  cpuset: introduce partition_enable()
  cpuset: introduce partition_disable()
  cpuset: introduce partition_update()
  cpuset: use partition_enable() for remote partition enablement
  cpuset: use partition_disable() for remote partition disablement
  cpuset: use partition_update() for remote partition update
  cpuset: introduce local_partition_enable()
  cpuset: introduce local_partition_disable()
  cpuset: introduce local_partition_invalidate()
  cpuset: introduce local_partition_update()
  cpuset: remove update_parent_effective_cpumask
  cpuset: remove redundant partition field updates
  cpuset: simplify partition update logic for hotplug tasks
  cpuset: unify local partition disable and invalidate
  cpuset: use partition_disable for compute_partition_effective_cpumask
  cpuset: use validate_local_partition in local_partition_enable
  cpuset: introduce validate_remote_partition
  cpuset: simplify update_prstate() function
  cpuset: remove prs_err clear when notify_partition_change

 kernel/cgroup/cpuset.c | 1000 +++++++++++++++++++---------------------
 1 file changed, 463 insertions(+), 537 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2025-11-13  7:22 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-25  6:48 [PATCH RFC v2 00/22] cpuset: rework local partition logic Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 01/22] cpuset: fix isolcpus stay in root when isolated partition changes to root Chen Ridong
2025-11-12 20:09   ` Waiman Long
2025-11-13  1:24     ` Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 02/22] cpuset: add early empty cpumask check in partition_xcpus_add/del Chen Ridong
2025-11-12 20:18   ` Waiman Long
2025-11-13  1:36     ` Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 03/22] cpuset: generalize validate_partition() interface Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 04/22] cpuset: introduce partition_enable() Chen Ridong
2025-11-12 20:40   ` Waiman Long
2025-11-13  1:38     ` Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 05/22] cpuset: introduce partition_disable() Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 06/22] cpuset: introduce partition_update() Chen Ridong
2025-11-12 20:58   ` Waiman Long
2025-11-13  7:22     ` Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 07/22] cpuset: use partition_enable() for remote partition enablement Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 08/22] cpuset: use partition_disable() for remote partition disablement Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 09/22] cpuset: use partition_update() for remote partition update Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 10/22] cpuset: introduce local_partition_enable() Chen Ridong
2025-11-12 21:47   ` Waiman Long
2025-11-13  2:49     ` Chen Ridong
2025-11-13  2:58       ` Waiman Long
2025-11-13  7:16         ` Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 11/22] cpuset: introduce local_partition_disable() Chen Ridong
2025-11-12 22:10   ` Waiman Long
2025-11-13  3:27     ` Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 12/22] cpuset: introduce local_partition_invalidate() Chen Ridong
2025-11-12 22:54   ` Waiman Long
2025-11-13  7:03     ` Chen Ridong
2025-11-13  0:15   ` Waiman Long
2025-10-25  6:48 ` [PATCH RFC v2 13/22] cpuset: introduce local_partition_update() Chen Ridong
2025-11-13  2:06   ` Waiman Long
2025-11-13  6:33     ` Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 14/22] cpuset: remove update_parent_effective_cpumask Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 15/22] cpuset: remove redundant partition field updates Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 16/22] cpuset: simplify partition update logic for hotplug tasks Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 17/22] cpuset: unify local partition disable and invalidate Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 18/22] cpuset: use partition_disable for compute_partition_effective_cpumask Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 19/22] cpuset: use validate_local_partition in local_partition_enable Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 20/22] cpuset: introduce validate_remote_partition Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 21/22] cpuset: simplify update_prstate() function Chen Ridong
2025-10-25  6:48 ` [PATCH RFC v2 22/22] cpuset: remove prs_err clear when notify_partition_change Chen Ridong
2025-11-03 11:18 ` [PATCH RFC v2 00/22] cpuset: rework local partition logic Chen Ridong
2025-11-12  4:11   ` Chen Ridong
2025-11-12  4:19     ` Waiman Long
2025-11-12  4:49       ` Chen Ridong

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