[PATCH -next v2 0/6] cpuset: further separate v1 and v2 implementations

Chen Ridong posted 6 patches 1 month, 3 weeks ago
include/linux/cpuset.h          |   2 +
kernel/cgroup/cpuset-internal.h |  42 +++++-
kernel/cgroup/cpuset-v1.c       | 241 +++++++++++++++++++++++++++++-
kernel/cgroup/cpuset.c          | 253 +++++---------------------------
4 files changed, 312 insertions(+), 226 deletions(-)
[PATCH -next v2 0/6] cpuset: further separate v1 and v2 implementations
Posted by Chen Ridong 1 month, 3 weeks ago
From: Chen Ridong <chenridong@huawei.com>

Most of the v1-specific code has already been moved to cpuset-v1.c, but
some parts remain in cpuset.c, such as the handling of CS_SPREAD_PAGE,
CS_SPREAD_SLAB, and CGRP_CPUSET_CLONE_CHILDREN. These can also be moved
to cpuset-v1.c.

Additionally, several cpuset members are specific to v1, including
fmeter, relax_domain_level, and the uf_node node. These should only be
visible when v1 support is enabled (CONFIG_CPUSETS_V1).

This series relocates the remaining v1-specific code to cpuset-v1.c and
guards v1-only members with CONFIG_CPUSETS_V1.

The most significant change is the separation of generate_sched_domains()
into v1 and v2 versions. For v1, the original function is preserved
with v2-specific code removed, keeping it largely unchanged since v1 is
deprecated and receives minimal future updates. For v2, all v1-specific
code has been removed, resulting in a much simpler and more maintainable
implementation.

---

v2:
patch1: remame assert_cpuset_lock_held to lockdep_assert_cpuset_lock_held.
patch5: remove some unnecessary v1 code.
patch6: add comment before the goto generate_doms label in the v2 version.

Chen Ridong (6):
  cpuset: add lockdep_assert_cpuset_lock_held helper
  cpuset: add cpuset1_online_css helper for v1-specific operations
  cpuset: add cpuset1_init helper for v1 initialization
  cpuset: move update_domain_attr_tree to cpuset_v1.c
  cpuset: separate generate_sched_domains for v1 and v2
  cpuset: remove v1-specific code from generate_sched_domains

 include/linux/cpuset.h          |   2 +
 kernel/cgroup/cpuset-internal.h |  42 +++++-
 kernel/cgroup/cpuset-v1.c       | 241 +++++++++++++++++++++++++++++-
 kernel/cgroup/cpuset.c          | 253 +++++---------------------------
 4 files changed, 312 insertions(+), 226 deletions(-)

-- 
2.34.1
Re: [PATCH -next v2 0/6] cpuset: further separate v1 and v2 implementations
Posted by Tejun Heo 1 month, 3 weeks ago
> Chen Ridong (6):
>   cpuset: add lockdep_assert_cpuset_lock_held helper
>   cpuset: add cpuset1_online_css helper for v1-specific operations
>   cpuset: add cpuset1_init helper for v1 initialization
>   cpuset: move update_domain_attr_tree to cpuset_v1.c
>   cpuset: separate generate_sched_domains for v1 and v2
>   cpuset: remove v1-specific code from generate_sched_domains

Applied 1-6 to cgroup/for-6.20.

Thanks.

-- 
tejun
Re: [PATCH -next v2 0/6] cpuset: further separate v1 and v2 implementations
Posted by Chen Ridong 1 month, 3 weeks ago

On 2025/12/19 2:39, Tejun Heo wrote:
>> Chen Ridong (6):
>>   cpuset: add lockdep_assert_cpuset_lock_held helper
>>   cpuset: add cpuset1_online_css helper for v1-specific operations
>>   cpuset: add cpuset1_init helper for v1 initialization
>>   cpuset: move update_domain_attr_tree to cpuset_v1.c
>>   cpuset: separate generate_sched_domains for v1 and v2
>>   cpuset: remove v1-specific code from generate_sched_domains
> 
> Applied 1-6 to cgroup/for-6.20.
> 
> Thanks.
> 

Thank you.

-- 
Best regards,
Ridong
Re: [PATCH -next v2 0/6] cpuset: further separate v1 and v2 implementations
Posted by Waiman Long 1 month, 3 weeks ago
On 12/18/25 4:31 AM, Chen Ridong wrote:
> From: Chen Ridong <chenridong@huawei.com>
>
> Most of the v1-specific code has already been moved to cpuset-v1.c, but
> some parts remain in cpuset.c, such as the handling of CS_SPREAD_PAGE,
> CS_SPREAD_SLAB, and CGRP_CPUSET_CLONE_CHILDREN. These can also be moved
> to cpuset-v1.c.
>
> Additionally, several cpuset members are specific to v1, including
> fmeter, relax_domain_level, and the uf_node node. These should only be
> visible when v1 support is enabled (CONFIG_CPUSETS_V1).
>
> This series relocates the remaining v1-specific code to cpuset-v1.c and
> guards v1-only members with CONFIG_CPUSETS_V1.
>
> The most significant change is the separation of generate_sched_domains()
> into v1 and v2 versions. For v1, the original function is preserved
> with v2-specific code removed, keeping it largely unchanged since v1 is
> deprecated and receives minimal future updates. For v2, all v1-specific
> code has been removed, resulting in a much simpler and more maintainable
> implementation.
>
> ---
>
> v2:
> patch1: remame assert_cpuset_lock_held to lockdep_assert_cpuset_lock_held.
> patch5: remove some unnecessary v1 code.
> patch6: add comment before the goto generate_doms label in the v2 version.
>
> Chen Ridong (6):
>    cpuset: add lockdep_assert_cpuset_lock_held helper
>    cpuset: add cpuset1_online_css helper for v1-specific operations
>    cpuset: add cpuset1_init helper for v1 initialization
>    cpuset: move update_domain_attr_tree to cpuset_v1.c
>    cpuset: separate generate_sched_domains for v1 and v2
>    cpuset: remove v1-specific code from generate_sched_domains
>
>   include/linux/cpuset.h          |   2 +
>   kernel/cgroup/cpuset-internal.h |  42 +++++-
>   kernel/cgroup/cpuset-v1.c       | 241 +++++++++++++++++++++++++++++-
>   kernel/cgroup/cpuset.c          | 253 +++++---------------------------
>   4 files changed, 312 insertions(+), 226 deletions(-)
>
For the whole series,

Reviewed-by: Waiman Long <longman@redhat.com>