Thread (27 messages) 27 messages, 6 authors, 2024-10-24

Re: [PATCH v6 2/8] mm: vmalloc: don't account for number of nodes for HUGE_VMAP allocations

From: Luis Chamberlain <mcgrof@kernel.org>
Date: 2024-10-19 22:19:28
Also in: bpf, linux-alpha, linux-arch, linux-m68k, linux-mips, linux-mm, linux-modules, linux-riscv, linux-sh, linux-um, linuxppc-dev, lkml, loongarch, sparclinux

On Wed, Oct 16, 2024 at 03:24:18PM +0300, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>

vmalloc allocations with VM_ALLOW_HUGE_VMAP that do not explicitly
specify node ID will use huge pages only if size_per_node is larger than
a huge page.
Still the actual allocated memory is not distributed between nodes and
there is no advantage in such approach.
On the contrary, BPF allocates SZ_2M * num_possible_nodes() for each
new bpf_prog_pack, while it could do with a single huge page per pack.

Don't account for number of nodes for VM_ALLOW_HUGE_VMAP with
NUMA_NO_NODE and use huge pages whenever the requested allocation size
is larger than a huge page.

Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>

  Luis
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help