Commit ef75d834 authored by Kohei Enju's avatar Kohei Enju Committed by Jakub Kicinski
Browse files

neighbour: Replace kvzalloc() with kzalloc() when GFP_ATOMIC is specified



kzalloc() uses page allocator when size is larger than
KMALLOC_MAX_CACHE_SIZE, so the intention of commit ab101c55
("neighbour: use kvzalloc()/kvfree()") can be achieved by using kzalloc().

When using GFP_ATOMIC, kvzalloc() only tries the kmalloc path,
since the vmalloc path does not support the flag.
In this case, kvzalloc() is equivalent to kzalloc() in that neither try
the vmalloc path, so this replacement brings no functional change.
This is primarily a cleanup change, as the original code functions
correctly.

This patch replaces kvzalloc() introduced by commit 41b3caa7
("neighbour: Add hlist_node to struct neighbour"), which is called in
the same context and with the same gfp flag as the aforementioned commit
ab101c55 ("neighbour: use kvzalloc()/kvfree()").

Signed-off-by: default avatarKohei Enju <enjuk@amazon.com>
Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
Link: https://patch.msgid.link/20250219102227.72488-1-enjuk@amazon.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 5225861b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment