On 2025/11/14 14:33, Sun Shaojie wrote:
> On 2025/11/14 08:50, Chen Ridong Wrote:
>> On 2025/11/13 21:14, 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() &&
>>> +       (is_cpu_exclusive(cs1) != is_cpu_exclusive(cs2)))
>>>             return !cpusets_are_exclusive(cs1, cs2);
>>>  
>>
>> I prefer adding a helper function in the cpuset-v1.c file, similar to 
>> cpus_excl_conflict_legacy().
>>
>> For cpuset v1, it can simply return cpus_excl_conflict_legacy(). It seems 
>> that other rules are not
>> relevant to v1.
>>
>>>     /* Exclusive_cpus cannot intersect */
> 
> Hi, Ridong,
> 
> Thank you for the suggestion.I will update the patch accordingly.
> 

If we are ready to relax this rule, adding the v1 logic in 
cpuset1_validate_change might be
appropriate. However, as I mentioned in my reply to Michal, I believe further 
discussion is needed.

-- 
Best regards,
Ridong


Reply via email to