lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a7296ecc-7d29-41aa-abc1-eec0900ce351@huaweicloud.com>
Date: Tue, 16 Sep 2025 16:02:20 +0800
From: Chen Ridong <chenridong@...weicloud.com>
To: Waiman Long <llong@...hat.com>, tj@...nel.org, hannes@...xchg.org,
 mkoutny@...e.com
Cc: cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
 lujialin4@...wei.com, chenridong@...wei.com
Subject: Re: [PATCH -next RFC -v2 11/11] cpuset: use partition_cpus_change for
 setting exclusive cpus



On 2025/9/16 4:05, Waiman Long wrote:
> On 9/8/25 11:32 PM, Chen Ridong wrote:
>> From: Chen Ridong <chenridong@...wei.com>
>>
>> Previous patches have refactored partition_cpus_change. Now replace the
>> exclusive cpus setting logic with this helper function.
> Nit: The term "refactor" usually mean updating the code of an existing function, sometimes
> extracting out code into new helper functions. In your case, partition_cpus_change() is a new helper
> function. This is also an issue in some of the earlier patches. I would prefer using phrase like "A
> previous patch has introduced a new helper function partition_cpus_change()"

Thank you, will update.

>>
>> Signed-off-by: Chen Ridong <chenridong@...wei.com>
>> ---
>>   kernel/cgroup/cpuset.c | 29 ++---------------------------
>>   1 file changed, 2 insertions(+), 27 deletions(-)
>>
>> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
>> index 785a2740b0ea..6a44dfabe9dd 100644
>> --- a/kernel/cgroup/cpuset.c
>> +++ b/kernel/cgroup/cpuset.c
>> @@ -2562,8 +2562,6 @@ static int update_exclusive_cpumask(struct cpuset *cs, struct cpuset *trialcs,
>>   {
>>       int retval;
>>       struct tmpmasks tmp;
>> -    struct cpuset *parent = parent_cs(cs);
>> -    bool invalidate = false;
>>       bool force = false;
>>       int old_prs = cs->partition_root_state;
>>   @@ -2595,32 +2593,9 @@ static int update_exclusive_cpumask(struct cpuset *cs, struct cpuset
>> *trialcs,
>>       if (alloc_tmpmasks(&tmp))
>>           return -ENOMEM;
>>   -    if (old_prs) {
>> -        if (cpumask_empty(trialcs->effective_xcpus)) {
>> -            invalidate = true;
>> -            cs->prs_err = PERR_INVCPUS;
>> -        } else if (prstate_housekeeping_conflict(old_prs, trialcs->effective_xcpus)) {
>> -            invalidate = true;
>> -            cs->prs_err = PERR_HKEEPING;
>> -        } else if (tasks_nocpu_error(parent, cs, trialcs->effective_xcpus)) {
>> -            invalidate = true;
>> -            cs->prs_err = PERR_NOCPUS;
>> -        }
>> +    trialcs->prs_err = PERR_NONE;
>> +    partition_cpus_change(cs, trialcs, &tmp);
>>   -        if (is_remote_partition(cs)) {
>> -            if (invalidate)
>> -                remote_partition_disable(cs, &tmp);
>> -            else
>> -                remote_cpus_update(cs, trialcs->exclusive_cpus,
>> -                           trialcs->effective_xcpus, &tmp);
>> -        } else if (invalidate) {
>> -            update_parent_effective_cpumask(cs, partcmd_invalidate,
>> -                            NULL, &tmp);
>> -        } else {
>> -            update_parent_effective_cpumask(cs, partcmd_update,
>> -                        trialcs->effective_xcpus, &tmp);
>> -        }
>> -    }
>>       spin_lock_irq(&callback_lock);
>>       cpumask_copy(cs->exclusive_cpus, trialcs->exclusive_cpus);
>>       cpumask_copy(cs->effective_xcpus, trialcs->effective_xcpus);
> Reviewed-by: Waiman Long <longman@...hat.com>

-- 
Best regards,
Ridong


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ