[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20251113064204.507472-1-sunshaojie@kylinos.cn>
Date: Thu, 13 Nov 2025 14:42:04 +0800
From: Sun Shaojie <sunshaojie@...inos.cn>
To: llong@...hat.com
Cc: cgroups@...r.kernel.org,
chenridong@...weicloud.com,
hannes@...xchg.org,
linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org,
mkoutny@...e.com,
shuah@...nel.org,
sunshaojie@...inos.cn,
tj@...nel.org
Subject: Re: [PATCH v1] cpuset: Avoid unnecessary partition invalidation
On 2025/11/13 12:12, Waiman Long wrote:
>On 11/12/25 10:33 PM, Sun Shaojie wrote:
>> The reviewer mentioned they couldn't see my original patch, so I'm
>> re-quoting the key changes below for clarity:
>>
>>> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
>>> index 52468d2c178a..e0d27c9a101a 100644
>>> --- a/kernel/cgroup/cpuset.c
>>> +++ b/kernel/cgroup/cpuset.c
>>> @@ -586,14 +586,14 @@ static inline bool cpusets_are_exclusive(struct cpuset *cs1, struct cpuset *cs2)
>>> * Returns: true if CPU exclusivity conflict exists, false otherwise
>>> *
>>> * Conflict detection rules:
>>> - * 1. If either cpuset is CPU exclusive, they must be mutually exclusive
>>> + * 1. If both cpusets are exclusive, they must be mutually exclusive
>>> * 2. exclusive_cpus masks cannot intersect between cpusets
>>> * 3. The allowed CPUs of one cpuset cannot be a subset of another's exclusive CPUs
>>> */
>>> static inline bool cpus_excl_conflict(struct cpuset *cs1, struct cpuset *cs2)
>>> {
>>> - /* If either cpuset is exclusive, check if they are mutually exclusive */
>>> - if (is_cpu_exclusive(cs1) || is_cpu_exclusive(cs2))
>>> + /* If both cpusets are exclusive, check if they are mutually exclusive */
>>> + if (is_cpu_exclusive(cs1) && is_cpu_exclusive(cs2))
>>> return !cpusets_are_exclusive(cs1, cs2);
>>>
>>> /* Exclusive_cpus cannot intersect */
>> Here are the main changes, where the conflict check for step #6 in Table 2
>> is performed. And these changes have no effect on cgroup v1.
>
>cpus_excl_conflict() is called by validate_change() which is used for
>both v1 and v2.
>
>Cheers,
>Longman
Hi,Longman
Thanks for pointing this out. I will make the necessary updates.
Thanks,
Sun Shaojie
Powered by blists - more mailing lists