[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251114055348.679854-1-sunshaojie@kylinos.cn>
Date: Fri, 14 Nov 2025 13:53:48 +0800
From: Sun Shaojie <sunshaojie@...inos.cn>
To: llong@...hat.com
Cc: chenridong@...weicloud.com,
cgroups@...r.kernel.org,
hannes@...xchg.org,
linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org,
mkoutny@...e.com,
shuah@...nel.org,
tj@...nel.org
Subject: Re: [PATCH v2] cpuset: relax the overlap check for cgroup-v2
On 2025/11/13 22:57, Waiman Long wrote:
>On 11/13/25 8:14 AM, Sun Shaojie wrote:
>> ...
>> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
>> index 52468d2c178a..3240b3ab5998 100644
>> --- a/kernel/cgroup/cpuset.c
>> +++ b/kernel/cgroup/cpuset.c
>> @@ -592,8 +592,13 @@ static inline bool cpusets_are_exclusive(struct cpuset *cs1, struct cpuset *cs2)
>> */
>> 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);
>> +
>> + /* In cgroup-v1, if either cpuset is exclusive, check if they are mutually exclusive */
>> + if (!is_in_v2_mode() &&
>
>You should just use cpuset_v2() here as is_in_v2_mode() checks an
>additional v1 specific mode that is irrelevant wrt to exclusive bit
>handling. Also please update the functional comment about difference in
>v1 vs. v2 behavior.
>
>Note that we may have to update other conflict checking code in cpuset.c
>to make this new behavior more consistent.
>
>Thanks,
>Longman
>
>> + (is_cpu_exclusive(cs1) != is_cpu_exclusive(cs2)))
>> return !cpusets_are_exclusive(cs1, cs2);
>>
>> /* Exclusive_cpus cannot intersect */
Thank you for the correction.I will update the patch accordingly.
Tnanks,
Sun Shaojie
Powered by blists - more mailing lists