linux-stable/net/netlink
Eric Dumazet f8cbf6bde4 netlink: use kvmalloc() in netlink_alloc_large_skb()
This is a followup of commit 234ec0b603 ("netlink: fix potential
sleeping issue in mqueue_flush_file"), because vfree_atomic()
overhead is unfortunate for medium sized allocations.

1) If the allocation is smaller than PAGE_SIZE, do not bother
   with vmalloc() at all. Some arches have 64KB PAGE_SIZE,
   while NLMSG_GOODSIZE is smaller than 8KB.

2) Use kvmalloc(), which might allocate one high order page
   instead of vmalloc if memory is not too fragmented.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Zhengchao Shao <shaozhengchao@huawei.com>
Link: https://lore.kernel.org/r/20240224090630.605917-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-02-27 08:31:28 -08:00
..
af_netlink.c netlink: use kvmalloc() in netlink_alloc_large_skb() 2024-02-27 08:31:28 -08:00
af_netlink.h rtnetlink: change nlk->cb_mutex role 2024-02-26 11:46:12 +00:00
diag.c netlink: fix netlink_diag_dump() return value 2024-02-26 11:46:12 +00:00
genetlink.c genetlink: Add per family bind/unbind callbacks 2024-02-15 17:49:16 -08:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile netlink: add infrastructure to expose policies to userspace 2020-04-30 17:51:42 -07:00
policy.c netlink: add variable-length / auto integers 2023-10-20 11:43:35 +01:00