cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chen Ridong <chenridong@huaweicloud.com>
To: Waiman Long <llong@redhat.com>,
	tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com
Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	lujialin4@huawei.com, chenridong@huawei.com
Subject: Re: [PATCH -next RFC 08/11] cpuset: refactor acpus_validate_change
Date: Sat, 30 Aug 2025 09:42:20 +0800	[thread overview]
Message-ID: <c665908a-6591-4c9d-93c0-0e69dc831495@huaweicloud.com> (raw)
In-Reply-To: <ca3bcede-2289-4e51-a2db-0da75d85fcbc@redhat.com>



On 2025/8/30 4:12, Waiman Long wrote:
> On 8/28/25 8:56 AM, Chen Ridong wrote:
>> From: Chen Ridong <chenridong@huawei.com>
>>
>> Refactor acpus_validate_change to handle the special case where
>> cpuset.cpus can be set even when violating partition sibling CPU
>> exclusivity rules. This differs from the general validation logic in
>> validate_change. Add a wrapper function to properly handle this
>> exceptional case.
>>
>> Since partition invalidation status can be determined by trialcs->prs_err,
>> the local variable 'bool invalidate' can be removed.
>>
>> Signed-off-by: Chen Ridong <chenridong@huawei.com>
>> ---
>>   kernel/cgroup/cpuset.c | 83 +++++++++++++++++++++++-------------------
>>   1 file changed, 45 insertions(+), 38 deletions(-)
>>
>> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
>> index 71190f142700..75ad18ab40ae 100644
>> --- a/kernel/cgroup/cpuset.c
>> +++ b/kernel/cgroup/cpuset.c
>> @@ -2410,43 +2410,11 @@ static bool invalidate_cs_partition(struct cpuset *cs)
>>       return false;
>>   }
>>   -/**
>> - * update_cpumask - update the cpus_allowed mask of a cpuset and all tasks in it
>> - * @cs: the cpuset to consider
>> - * @trialcs: trial cpuset
>> - * @buf: buffer of cpu numbers written to this cpuset
>> - */
>> -static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
>> -              const char *buf)
>> +static int acpus_validate_change(struct cpuset *cs, struct cpuset *trialcs,
>> +                    struct tmpmasks *tmp)
> 
> What does "acpu" stand for? I suppose it means cpus_allowed. I will suggest to use a more
> descriptive name even if it is longer. I did use xcpus for exclusive_cpus, but 'x' is a seldomly
> used English alphabet that can associate with exclusive_cpus rather easily, but 'a' is not.
> 
> Cheers,
> Longman
> 

Thanks Longman,

The term acpus refers to cpus_allowed.

My original naming convention was intended as follows:

acpus  --> cpus_allowed (allowed cpus)
ecpus  --> effective_cpus
xcpus  --> exclusive_cpus
excpus --> effective_xcpus

-- 
Best regards,
Ridong


  reply	other threads:[~2025-08-30  1:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-28 12:56 [PATCH -next RFC 00/11] Refactor cpus mask setting Chen Ridong
2025-08-28 12:56 ` [PATCH -next RFC 01/11] cpuset: move the root cpuset write check earlier Chen Ridong
2025-08-29 19:21   ` Waiman Long
2025-08-30  1:11     ` Chen Ridong
2025-08-28 12:56 ` [PATCH -next RFC 02/11] cpuset: remove unused assignment to trialcs->partition_root_state Chen Ridong
2025-08-28 12:56 ` [PATCH -next RFC 03/11] cpuset: change return type of is_partition_[in]valid to bool Chen Ridong
2025-08-28 12:56 ` [PATCH -next RFC 04/11] cpuset: Refactor exclusive CPU mask computation logic Chen Ridong
2025-08-28 12:56 ` [PATCH -next RFC 05/11] cpuset: refactor CPU mask buffer parsing logic Chen Ridong
2025-08-28 12:56 ` [PATCH -next RFC 06/11] cpuset: introduce cpus_excl_conflict and mems_excl_conflict helpers Chen Ridong
2025-08-29 19:29   ` Waiman Long
2025-08-30  1:27     ` Chen Ridong
2025-08-28 12:56 ` [PATCH -next RFC 07/11] cpuset: refactor out invalidate_cs_partition Chen Ridong
2025-08-29 19:56   ` Waiman Long
2025-08-30  1:33     ` Chen Ridong
2025-08-28 12:56 ` [PATCH -next RFC 08/11] cpuset: refactor acpus_validate_change Chen Ridong
2025-08-29 20:12   ` Waiman Long
2025-08-30  1:42     ` Chen Ridong [this message]
2025-08-28 12:56 ` [PATCH -next RFC 09/11] cpuset: refactor partition_cpus_change Chen Ridong
2025-08-29 20:32   ` Waiman Long
2025-08-30  2:01     ` Chen Ridong
2025-09-02 13:30       ` Waiman Long
2025-09-03  0:51         ` Chen Ridong
2025-08-28 12:56 ` [PATCH -next RFC 10/11] cpuset: use parse_cpulist for setting cpus.exclusive Chen Ridong
2025-08-28 12:56 ` [PATCH -next RFC 11/11] cpuset: use partition_cpus_change for setting exclusive cpus Chen Ridong

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=c665908a-6591-4c9d-93c0-0e69dc831495@huaweicloud.com \
    --to=chenridong@huaweicloud.com \
    --cc=cgroups@vger.kernel.org \
    --cc=chenridong@huawei.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llong@redhat.com \
    --cc=lujialin4@huawei.com \
    --cc=mkoutny@suse.com \
    --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;
as well as URLs for NNTP newsgroup(s).