From: Chen Ridong <chenridong@huaweicloud.com>
To: Sun Shaojie <sunshaojie@kylinos.cn>
Cc: cgroups@vger.kernel.org, hannes@cmpxchg.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
llong@redhat.com, mkoutny@suse.com, shuah@kernel.org,
tj@kernel.org
Subject: Re: [PATCH v5] cpuset: Avoid invalidating sibling partitions on cpuset.cpus conflict.
Date: Sat, 22 Nov 2025 09:33:34 +0800 [thread overview]
Message-ID: <0c409964-c4aa-4d41-aae5-cd0626015eeb@huaweicloud.com> (raw)
In-Reply-To: <20251121103217.1661443-1-sunshaojie@kylinos.cn>
On 2025/11/21 18:32, Sun Shaojie wrote:
> Hi, Ridong,
>
> On Thu, 20 Nov 2025 21:45:16, Chen Ridong wrote:
>> On 2025/11/20 21:07, Sun Shaojie wrote:
>>> I have carefully considered the scenario where parent effective CPUs are
>>> empty, which corresponds to the following two cases. (After apply this patch).
>>>
>>> root cgroup
>>> |
>>> A1
>>> / \
>>> A2 A3
>>>
>>> Case 1:
>>> Step:
>>> #1> echo "0-1" > A1/cpuset.cpus
>>> #2> echo "root" > A1/cpuset.cpus.partition
>>> #3> echo "0-1" > A2/cpuset.cpus
>>> #4> echo "root" > A2/cpuset.cpus.partition
>>>
>>> After step #4,
>>>
>>> | A1 | A2 | A3 |
>>> cpus_allowed | 0-1 | 0-1 | |
>>> effective_cpus | | 0-1 | |
>>> prstate | root | root | member |
>>>
>>> After step #4, A3's effective CPUs is empty.
>>>
>>
>> That may be a corner case is unexpected.
>>
>>> #5> echo "0-1" > A3/cpuset.cpus
>>>
>>
>> If we create subdirectories (e.g., A4, A5, ...) under the A1 cpuset and then configure cpuset.cpus
>> for A1 (a common usage scenario), processes can no longer be migrated into these subdirectories (A4,
>> A5, ...) afterward. However, prior to your patch, this migration was allowed.
>
> Are you referring to creating subdirectories (A4, A5, ...) after step #4?
> And what parameters should be configured for A1's cpuset.cpus?
> Could you provide a specific example?
>
#1> echo "0-1" > A1/cpuset.cpus
#2> echo "root" > A1/cpuset.cpus.partition
#3> echo "0-1" > A2/cpuset.cpus
#4> echo "root" > A2/cpuset.cpus.partition
mkdir A4
mkdir A5
echo "0" > A4/cpuset.cpus
echo $$ > A4/cgroup.procs
echo "1" > A5/cpuset.cpus
echo $$ > A5/cgroup.procs
You might be going to argue that we haven't set the cpus for A4/A5..., yeah, maybe a corner case.
However, it’s common practice to configure a cpuset’s cpus first and then migrate processes—this is
a typical usage scenario.
> Additionally, processes cannot be migrated into a cgroup whose
> cpuset.cpus.effective is empty. However, this patch does not modify this behavior.
>
> So why does applying this patch enable such migration?
>
--
Best regards,
Ridong
next prev parent reply other threads:[~2025-11-22 1:33 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-17 1:57 [PATCH v3 0/1] cpuset: relax the overlap check for cgroup-v2 Sun Shaojie
2025-11-17 1:57 ` [PATCH v4 1/1] " Sun Shaojie
2025-11-17 7:45 ` Chen Ridong
2025-11-17 10:00 ` Sun Shaojie
2025-11-17 11:37 ` Chen Ridong
2025-11-19 10:57 ` [PATCH v5] cpuset: Avoid invalidating sibling partitions on cpuset.cpus conflict Sun Shaojie
2025-11-19 13:20 ` Michal Koutný
2025-11-20 0:57 ` Chen Ridong
2025-11-20 13:07 ` Sun Shaojie
2025-11-20 13:25 ` Chen Ridong
2025-11-21 10:33 ` Sun Shaojie
2025-11-22 1:19 ` Chen Ridong
2025-11-24 10:21 ` Sun Shaojie
2025-11-20 13:05 ` Sun Shaojie
2025-11-26 14:13 ` Michal Koutný
2025-11-27 1:57 ` Chen Ridong
2025-12-01 9:42 ` Sun Shaojie
2025-11-20 0:51 ` Chen Ridong
2025-11-20 13:07 ` Sun Shaojie
2025-11-20 13:45 ` Chen Ridong
2025-11-21 10:32 ` Sun Shaojie
2025-11-22 1:33 ` Chen Ridong [this message]
2025-11-24 10:20 ` Sun Shaojie
2025-11-24 11:33 ` Chen Ridong
2025-11-26 12:29 ` Sun Shaojie
2025-11-24 22:30 ` Waiman Long
2025-11-26 12:31 ` Sun Shaojie
2025-11-26 14:13 ` Michal Koutný
2025-11-26 19:43 ` Waiman Long
2025-11-27 1:55 ` Chen Ridong
2025-12-01 9:44 ` Sun Shaojie
2025-12-08 14:31 ` Michal Koutný
2025-12-10 10:11 ` Sun Shaojie
2025-12-11 10:59 ` Michal Koutný
2025-12-12 10:10 ` Sun Shaojie
2025-12-13 0:52 ` Chen Ridong
2025-12-17 9:09 ` Sun Shaojie
2025-12-08 14:32 ` Michal Koutný
2025-12-13 4:58 ` Waiman Long
2025-12-01 9:38 ` [PATCH v6] " Sun Shaojie
2025-12-17 9:45 ` [PING][PATCH " Sun Shaojie
2025-12-23 6:06 ` Waiman Long
2025-12-22 15:26 ` [PATCH " Michal Koutný
2025-12-23 6:03 ` Waiman Long
2025-12-25 7:30 ` Waiman Long
2025-11-19 11:03 ` [PATCH v4 1/1] cpuset: relax the overlap check for cgroup-v2 Sun Shaojie
2025-11-18 17:52 ` Michal Koutný
2025-11-19 11:04 ` Sun Shaojie
2025-11-18 19:53 ` Waiman Long
2025-11-19 11:05 ` Sun Shaojie
2025-11-17 3:23 ` [PATCH v3 0/1] " Chen Ridong
2025-11-17 5:58 ` Sun Shaojie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0c409964-c4aa-4d41-aae5-cd0626015eeb@huaweicloud.com \
--to=chenridong@huaweicloud.com \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=llong@redhat.com \
--cc=mkoutny@suse.com \
--cc=shuah@kernel.org \
--cc=sunshaojie@kylinos.cn \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®