[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4366cedd-b9c7-48de-bb48-f3c4ff81e73e@huaweicloud.com>
Date: Mon, 17 Nov 2025 11:23:36 +0800
From: Chen Ridong <chenridong@...weicloud.com>
To: Sun Shaojie <sunshaojie@...inos.cn>, llong@...hat.com
Cc: mkoutny@...e.com, cgroups@...r.kernel.org, hannes@...xchg.org,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
shuah@...nel.org, tj@...nel.org
Subject: Re: [PATCH v3 0/1] cpuset: relax the overlap check for cgroup-v2
On 2025/11/17 9:57, Sun Shaojie 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.
>
> This patch ensures that for sibling cpusets A1 (exclusive) and B1
> (non-exclusive), change B1 cannot affect A1's exclusivity.
>
> for example. Assume a machine has 4 CPUs (0-3).
>
> root cgroup
> / \
> A1 B1
>
> Case 1:
> Table 1.1: Before applying the patch
> Step | A1's prstate | B1'sprstate |
> #1> echo "0-1" > A1/cpuset.cpus | member | member |
> #2> echo "root" > A1/cpuset.cpus.partition | root | member |
> #3> echo "0" > B1/cpuset.cpus | root invalid | member |
>
> After step #3, 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(from B1's parent), so it would be more reasonable for A1 to
> remain as "root."
>
> Table 1.2: After applying the patch
> Step | A1's prstate | B1'sprstate |
> #1> echo "0-1" > A1/cpuset.cpus | member | member |
> #2> echo "root" > A1/cpuset.cpus.partition | root | member |
> #3> echo "0" > B1/cpuset.cpus | root | member |
>
> Case 2: (This situation remains unchanged from before)
> Table 2.1: Before applying the patch
> Step | A1's prstate | B1'sprstate |
> #1> echo "0-1" > A1/cpuset.cpus | member | member |
> #3> echo "1-2" > B1/cpuset.cpus | member | member |
> #2> echo "root" > A1/cpuset.cpus.partition | root invalid | member |
>
> Table 2.2: After applying the patch
> Step | A1's prstate | B1'sprstate |
> #1> echo "0-1" > A1/cpuset.cpus | member | member |
> #3> echo "1-2" > B1/cpuset.cpus | member | member |
> #2> echo "root" > A1/cpuset.cpus.partition | root invalid | member |
>
> All other cases remain unaffected. For example, cgroup-v1, both A1 and
> B1 are exclusive or non-exlusive.
>
> ---
> v3 -> v4:
> - Adjust the test_cpuset_prt.sh test file to align with the current
> behavior.
>
> v2 -> v3:
> - Ensure compliance with constraints such as cpuset.cpus.exclusive.
> - Link: https://lore.kernel.org/cgroups/20251113131434.606961-1-sunshaojie@kylinos.cn/
>
> v1 -> v2:
> - Keeps the current cgroup v1 behavior unchanged
> - Link: https://lore.kernel.org/cgroups/c8e234f4-2c27-4753-8f39-8ae83197efd3@redhat.com
>
> ---
> kernel/cgroup/cpuset-internal.h | 3 ++
> kernel/cgroup/cpuset-v1.c | 20 +++++++++
> kernel/cgroup/cpuset.c | 43 ++++++++++++++-----
> .../selftests/cgroup/test_cpuset_prs.sh | 5 ++-
> 4 files changed, 58 insertions(+), 13 deletions(-)
>
Is this a cover letter?
The cover letter is labeled as v3, while the patch itself is v4.
For a single patch, I don’t think a cover letter is necessary.
--
Best regards,
Ridong
Powered by blists - more mailing lists