From: Liu Ye <liuye@kylinos.cn>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Liu Ye <liuye@kylinos.cn>
Subject: [PATCH] mm/mempool: Use kmalloc_array_node to replace kmalloc_array
Date: Fri, 7 Feb 2025 13:52:13 +0800 [thread overview]
Message-ID: <20250207055213.141890-1-liuye@kylinos.cn> (raw)
The kmalloc_array call could be replaced with kmalloc_array_node
to allocate memory on a specific NUMA node.
Signed-off-by: Liu Ye <liuye@kylinos.cn>
---
mm/mempool.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/mempool.c b/mm/mempool.c
index 3223337135d0..51eabcc87177 100644
--- a/mm/mempool.c
+++ b/mm/mempool.c
@@ -328,8 +328,8 @@ int mempool_resize(mempool_t *pool, int new_min_nr)
spin_unlock_irqrestore(&pool->lock, flags);
/* Grow the pool */
- new_elements = kmalloc_array(new_min_nr, sizeof(*new_elements),
- GFP_KERNEL);
+ new_elements = kmalloc_array_node(new_min_nr, sizeof(*new_elements),
+ GFP_KERNEL, NUMA_NO_NODE);
if (!new_elements)
return -ENOMEM;
--
2.25.1
next reply other threads:[~2025-02-07 5:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-07 5:52 Liu Ye [this message]
2025-02-07 6:47 ` Harry (Hyeonggon) Yoo
2025-02-07 7:51 ` liuye
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=20250207055213.141890-1-liuye@kylinos.cn \
--to=liuye@kylinos.cn \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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