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 v4 2/3] cpuset: separate tmpmasks and cpuset allocation logic
Date: Mon, 25 Aug 2025 08:52:18 +0800 [thread overview]
Message-ID: <abec1bda-82bf-430e-9747-5aa4fa6ccacd@huaweicloud.com> (raw)
In-Reply-To: <0b918f11-d850-4cdb-b9af-ffa436b8fd1e@redhat.com>
On 2025/8/25 1:05, Waiman Long wrote:
>
> On 8/18/25 2:41 AM, Chen Ridong wrote:
>> From: Chen Ridong <chenridong@huawei.com>
>>
>> The original alloc_cpumasks() served dual purposes: allocating cpumasks
>> for both temporary masks (tmpmasks) and cpuset structures. This patch:
>>
>> 1. Decouples these allocation paths for better code clarity
>> 2. Introduces dedicated alloc_tmpmasks() and dup_or_alloc_cpuset()
>> functions
>> 3. Maintains symmetric pairing:
>> - alloc_tmpmasks() ↔ free_tmpmasks()
>> - dup_or_alloc_cpuset() ↔ free_cpuset()
>>
>> Signed-off-by: Chen Ridong <chenridong@huawei.com>
>> ---
>> kernel/cgroup/cpuset.c | 128 ++++++++++++++++++++++-------------------
>> 1 file changed, 69 insertions(+), 59 deletions(-)
>>
>> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
>> index aebda14cc67f..d5588a1fef60 100644
>> --- a/kernel/cgroup/cpuset.c
>> +++ b/kernel/cgroup/cpuset.c
>> @@ -411,51 +411,46 @@ static void guarantee_online_mems(struct cpuset *cs, nodemask_t *pmask)
>> }
>> /**
>> - * alloc_cpumasks - allocate three cpumasks for cpuset
>> - * @cs: the cpuset that have cpumasks to be allocated.
>> - * @tmp: the tmpmasks structure pointer
>> - * Return: 0 if successful, -ENOMEM otherwise.
>> + * alloc_cpumasks - Allocate an array of cpumask variables
>> + * @pmasks: Pointer to array of cpumask_var_t pointers
>> + * @size: Number of cpumasks to allocate
>> *
>> - * Only one of the two input arguments should be non-NULL.
>> + * Allocates @size cpumasks and initializes them to empty. Returns 0 on
>> + * success, -ENOMEM on allocation failure. On failure, any previously
>> + * allocated cpumasks are freed.
>
> The convention for the kernel-doc is to have a "Return:" tag if the function has a returned value.
> That "Return:" tag is deleted by this change. Your description does describe the returned value and
> no test robot failure was reported. Other than that, the rest of the patch looks good to me.
>
> Cheers,
> Longman
>
Thank you Longman, will update.
--
Best regards,
Ridong
next prev parent reply other threads:[~2025-08-25 0:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-18 6:41 [PATCH -next v4 0/3] some optimization for cpuset Chen Ridong
2025-08-18 6:41 ` [PATCH -next v4 1/3] cpuset: decouple tmpmasks and cpumasks freeing in cgroup Chen Ridong
2025-08-24 17:07 ` Waiman Long
2025-08-18 6:41 ` [PATCH -next v4 2/3] cpuset: separate tmpmasks and cpuset allocation logic Chen Ridong
2025-08-24 17:05 ` Waiman Long
2025-08-25 0:52 ` Chen Ridong [this message]
2025-08-18 6:41 ` [PATCH -next v4 3/3] cpuset: add helpers for cpus read and cpuset_mutex locks Chen Ridong
2025-08-24 17:07 ` Waiman Long
2025-08-23 2:08 ` [PATCH -next v4 0/3] some optimization for cpuset 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=abec1bda-82bf-430e-9747-5aa4fa6ccacd@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).