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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <08d14514-3419-4aa8-9b20-cd95a45706e2@huaweicloud.com>
Date: Mon, 20 Oct 2025 16:44:37 +0800
From: Chen Ridong <chenridong@...weicloud.com>
To: Waiman Long <llong@...hat.com>, tj@...nel.org, hannes@...xchg.org,
 mkoutny@...e.com
Cc: cgups@...r.kernel.org, linux-kernel@...r.kernel.org,
 lujialin4@...wei.com, chenridong@...wei.com
Subject: Re: [PATCH -next RFC 11/16] cpuset: simplify partition update logic
 for hotplug tasks



On 2025/10/20 11:00, Waiman Long wrote:
> 
> On 9/28/25 3:13 AM, Chen Ridong wrote:
>> From: Chen Ridong <chenridong@...wei.com>
>>
>> Simplify the partition update logic in cpuset_hotplug_update_tasks() by
>> calling the unified local_partition_update() interface.
>>
>> For local partitions, the previous patch introduced local_partition_update
>> which handles both validation state transitions:
>> - Invalidates local partitions that fail validation checks
>> - Transitions invalid partitions to valid state when no errors are detected
>>
>> This eliminates the need for separate transition logic
>> in cpuset_hotplug_update_tasks(), which can now simply call
>> local_partition_update() to handle all local partition changes.
>>
>> This patch simplifies the logic by always proceeding to update_tasks for
>> remote partitions, regardless of whether they were disabled or not. Since
>> the original code didn't perform any meaningful operations for non-disabled
>> remote partitions, this change should not affect functionality.
>>
>> The partition_cmd mechanism can now be safely removed as it is no longer
> 
> It is partition_cmd enum type.
> 

Thank you,

Will update.

>> referenced by any code paths after the partition update logic
>> simplification.
>>
>> Signed-off-by: Chen Ridong <chenridong@...wei.com>
>> ---
>>   kernel/cgroup/cpuset.c | 67 ++++++++++++++++--------------------------
>>   1 file changed, 26 insertions(+), 41 deletions(-)
>>
>> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
>> index 9e98df542715..a1896a199c8b 100644
>> --- a/kernel/cgroup/cpuset.c
>> +++ b/kernel/cgroup/cpuset.c
>> @@ -1211,17 +1211,6 @@ static void compute_effective_cpumask(struct cpumask *new_cpus,
>>       cpumask_and(new_cpus, cs->cpus_allowed, parent->effective_cpus);
>>   }
>>   -/*
>> - * Commands for update_parent_effective_cpumask
>> - */
>> -enum partition_cmd {
>> -    partcmd_enable,        /* Enable partition root      */
>> -    partcmd_enablei,    /* Enable isolated partition root */
>> -    partcmd_disable,    /* Disable partition root      */
>> -    partcmd_update,        /* Update parent's effective_cpus */
>> -    partcmd_invalidate,    /* Make partition invalid      */
>> -};
>> -
>>   static void update_sibling_cpumasks(struct cpuset *parent, struct cpuset *cs,
>>                       struct tmpmasks *tmp);
>>   @@ -2062,6 +2051,9 @@ static int __local_partition_update(struct cpuset *cs, struct cpumask *xcpus,
>>           update_partition_sd_lb(cs, old_prs);
>>           return part_error;
>>       }
>> +    /* Nothing changes, return PERR_NONE */
>> +    if (new_prs == old_prs && cpumask_equal(excpus, cs->effective_xcpus))
>> +        return PERR_NONE;
> I believe you already have this check added when you introduce __local_partition_update() in patch
> 9. It is a duplicate.
> 
> Cheers,
> Longman

Thank you,

Will update.

-- 
Best regards,
Ridong


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ