[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251120130750.1554604-1-sunshaojie@kylinos.cn>
Date: Thu, 20 Nov 2025 21:07:50 +0800
From: Sun Shaojie <sunshaojie@...inos.cn>
To: chenridong@...weicloud.com
Cc: cgroups@...r.kernel.org,
hannes@...xchg.org,
linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org,
llong@...hat.com,
mkoutny@...e.com,
shuah@...nel.org,
sunshaojie@...inos.cn,
tj@...nel.org
Subject: Re: [PATCH v5] cpuset: Avoid invalidating sibling partitions on cpuset.cpus conflict.
Hi, Ridong,
On Thu, 20 Nov 2025 08:57:51, Chen Ridong wrote:
>On 2025/11/19 21:20, Michal Koutný wrote:
>> On Wed, Nov 19, 2025 at 06:57:49PM +0800, Sun Shaojie <sunshaojie@...inos.cn> wrote:
>>> Table 2.1: Before applying this patch
>>> Step | A1's prstate | B1's prstate |
>>> #1> echo "0-1" > A1/cpuset.cpus | member | member |
>>> #2> echo "root" > A1/cpuset.cpus.partition | root | member |
>>> #3> echo "2" > B1/cpuset.cpus | root | member |
>>> #4> echo "root" > B1/cpuset.cpus.partition | root | root |
>>> #5> echo "1-2" > B1/cpuset.cpus | root invalid | root invalid |
>>>
>>> After step #4, B1 can exclusively use CPU 2. Therefore, at step #5,
>>> regardless of what conflicting value B1 writes to cpuset.cpus, it will
>>> always have at least CPU 2 available. This makes it unnecessary to mark
>>> A1 as "root invalid".
>>>
>>> Table 2.2: After applying this patch
>>> Step | A1's prstate | B1's prstate |
>>> #1> echo "0-1" > A1/cpuset.cpus | member | member |
>>> #2> echo "root" > A1/cpuset.cpus.partition | root | member |
>>> #3> echo "2" > B1/cpuset.cpus | root | member |
>>> #4> echo "root" > B1/cpuset.cpus.partition | root | root |
>>> #5> echo "1-2" > B1/cpuset.cpus | root | root invalid |
>>>
>>> In summary, regardless of how B1 configures its cpuset.cpus, there will
>>> always be available CPUs in B1's cpuset.cpus.effective. Therefore, there
>>> is no need to change A1 from "root" to "root invalid".
>>
>> Admittedly, I don't like this change because it relies on implicit
>> preference ordering between siblings (here first comes, first served)
>
>Agree. If we only invalidate the latter one, I think regardless of the implementation approach, we
>may end up with different results depending on the order of operations.
I don't understand the "order of operations" mentioned here. After reviewing
the previous email content, are you referring to this?
On Sat, 15 Nov 2025 15:41:03, Chen Ridong wrote:
>With the result you expect, would we observe the following behaviors:
>
>#1> mkdir -p A1
>#2> mkdir -p B1
>#3> echo "0-1" > A1/cpuset.cpus
>#4> echo "1-2" > B1/cpuset.cpus
>#5> echo "root" > A1/cpuset.cpus.partition
>#6> echo "root" > B1/cpuset.cpus.partition # A1:root;B1:root invalid
>
>#1> mkdir -p A1
>#2> mkdir -p B1
>#3> echo "0-1" > A1/cpuset.cpus
>#4> echo "1-2" > B1/cpuset.cpus
>#5> echo "root" > B1/cpuset.cpus.partition
>#6> echo "root" > A1/cpuset.cpus.partition # A1:root invalid;B1:root
>
>Do different operation orders yield different results? If so, this is not what we expect.
However, after applying this patch, the outcomes of these two examples are
as follows:
#1> mkdir -p A1
#2> mkdir -p B1
#3> echo "0-1" > A1/cpuset.cpus | member | member |
#4> echo "1-2" > B1/cpuset.cpus | member | member |
#5> echo "root" > A1/cpuset.cpus.partition | root invalid | root |
#6> echo "root" > B1/cpuset.cpus.partition | root invalid | root invalid|
#1> mkdir -p A1
#2> mkdir -p B1
#3> echo "0-1" > A1/cpuset.cpus | member | member |
#4> echo "1-2" > B1/cpuset.cpus | member | member |
#5> echo "root" > B1/cpuset.cpus.partition | root | root invalid|
#6> echo "root" > A1/cpuset.cpus.partition | root invalid | root invalid|
Moreover, even without applying this patch, the result remains the same,
because modifying cpuset.cpus.partition does not disable its siblings' partitions.
So, what are the specific issues that you believe would arise?
Thanks,
Sun Shaojie
Powered by blists - more mailing lists