mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chen Ridong <chenridong@huaweicloud.com>
To: Sun Shaojie <sunshaojie@kylinos.cn>
Cc: mkoutny@suse.com, llong@redhat.com, cgroups@vger.kernel.org,
	hannes@cmpxchg.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, shuah@kernel.org, tj@kernel.org
Subject: Re: [PATCH v2] cpuset: relax the overlap check for cgroup-v2
Date: Fri, 14 Nov 2025 14:59:08 +0800	[thread overview]
Message-ID: <df95cda2-71b5-403c-8644-3c114f69ba1a@huaweicloud.com> (raw)
In-Reply-To: <20251114063312.687950-1-sunshaojie@kylinos.cn>



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	other threads:[~2025-11-14  6:59 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-13 13:14 Sun Shaojie
2025-11-13 14:57 ` Waiman Long
2025-11-13 17:07 ` Michal Koutný
2025-11-14  1:29   ` Chen Ridong
2025-11-14 16:14     ` Michal Koutný
2025-11-15  0:58       ` Chen Ridong
2025-11-14  0:50 ` Chen Ridong
2025-11-14  5:53   ` Sun Shaojie
2025-11-14  6:24   ` Sun Shaojie
2025-11-14 16:15     ` Michal Koutný
2025-11-15  2:01       ` Chen Ridong
2025-11-15  9:31         ` [PATCH -next] cpuset: treate root invalid trialcs as exclusive Chen Ridong
2025-11-16 14:08           ` [PATCH v2] cpuset: relax the overlap check for cgroup-v2 Sun Shaojie
2025-11-17  4:35           ` [PATCH -next] cpuset: treate root invalid trialcs as exclusive Sun Shaojie
2025-11-17  6:23             ` Chen Ridong
2025-11-17  6:53               ` Sun Shaojie
2025-11-17  7:30                 ` Chen Ridong
2025-11-17 15:56           ` Waiman Long
2025-11-15  9:51         ` [PATCH v2] cpuset: relax the overlap check for cgroup-v2 Chen Ridong
2025-11-15 11:24       ` Sun Shaojie
2025-11-14  6:33   ` Sun Shaojie
2025-11-14  6:59     ` Chen Ridong [this message]
2025-11-15  6:02   ` Sun Shaojie
2025-11-15  7:41     ` Chen Ridong
2025-11-17 18:43     ` Waiman Long

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=df95cda2-71b5-403c-8644-3c114f69ba1a@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®