Re: [PATCH -next] cpuset: add cpuset1_online_css helper for v1-specific operations

From: Michal Koutný

Date: Tue Dec 16 2025 - 04:55:09 EST


On Tue, Dec 16, 2025 at 01:28:45AM +0000, Chen Ridong <chenridong@xxxxxxxxxxxxxxx> wrote:
> From: Chen Ridong <chenridong@xxxxxxxxxx>
>
> This commit introduces the cpuset1_online_css helper to centralize
> v1-specific handling during cpuset online. It performs operations such as
> updating the CS_SPREAD_PAGE, CS_SPREAD_SLAB, and CGRP_CPUSET_CLONE_CHILDREN
> flags, which are unique to the cpuset v1 control group interface.
>
> The helper is now placed in cpuset-v1.c to maintain clear separation
> between v1 and v2 logic.

It makes sense to me.

> +/* v1-specific operation — caller must hold cpuset_full_lock. */
> +void cpuset1_online_css(struct cgroup_subsys_state *css)
> +{
> + struct cpuset *tmp_cs;
> + struct cgroup_subsys_state *pos_css;
> + struct cpuset *cs = css_cs(css);
> + struct cpuset *parent = parent_cs(cs);
> +

+ lockdep_assert_held(&cpuset_mutex);
+ lockdep_assert_cpus_held();

When it's carved out from under cpuset_full_lock().


> @@ -3636,39 +3630,8 @@ static int cpuset_css_online(struct cgroup_subsys_state *css)
> cs->effective_mems = parent->effective_mems;
> }
> spin_unlock_irq(&callback_lock);
> + cpuset1_online_css(css);

guard with !is_in_v2mode()

Thanks,
Michal

Attachment: signature.asc
Description: PGP signature