Re: [PATCH v2] cpuset: relax the overlap check for cgroup-v2

From: Michal Koutný

Date: Thu Nov 13 2025 - 12:07:36 EST


Hello.

On Thu, Nov 13, 2025 at 09:14:34PM +0800, Sun Shaojie <sunshaojie@xxxxxxxxxx> wrote:
> In cgroup v2, a mutual overlap check is required when at least one of two
> cpusets is exclusive. However, this check should be relaxed and limited to
> cases where both cpusets are exclusive.
>
> The table 1 shows the partition states of A1 and B1 after each step before
> applying this patch.
>
> Table 1: Before applying the patch
> Step | A1's prstate | B1's prstate |
> #1> mkdir -p A1 | member | |
> #2> echo "0-1" > A1/cpuset.cpus | member | |
> #3> echo "root" > A1/cpuset.cpus.partition | root | |
> #4> mkdir -p B1 | root | member |
> #5> echo "0-3" > B1/cpuset.cpus | root invalid | member |
> #6> echo "root" > B1/cpuset.cpus.partition | root invalid | root invalid |
>
> After step #5, A1 changes from "root" to "root invalid" because its CPUs
> (0-1) overlap with those requested by B1 (0-3). However, B1 can actually
> use CPUs 2-3, so it would be more reasonable for A1 to remain as "root."

I remember there was the addition of cgroup_file_notify() for the
cpuset.cpus.partition so that such changes can be watched for.

I may not be seeing whole picture, so I ask -- why would it be "more
reasonable" for A1 to remain root. From this description it looks like
you'd silently convert B1's effective cpus to 2-3 but IIUC the code
change that won't happen but you'd reject the write of "0-3" instead.

Isn't here missing Table 2: After applying the patch? I'm asking because
of the number 1 but also because it'd make the intention clearer
;-), perhaps with a column for cpuset.cpus.effective.

Thanks,
Michal

Attachment: signature.asc
Description: PGP signature