]> git.baikalelectronics.ru Git - kernel.git/commit
vmalloc: replace VM_NO_HUGE_VMAP with VM_ALLOW_HUGE_VMAP
authorSong Liu <song@kernel.org>
Fri, 15 Apr 2022 16:44:10 +0000 (09:44 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 19 Apr 2022 19:08:57 +0000 (12:08 -0700)
commita9d2ec44bed5d48baadca67afb92577a341cc3a8
treeb4480a72841a160200f7ba9d3097d9db1d92cf9c
parentb193930d532d7d480c2a313387443e2dd90821ef
vmalloc: replace VM_NO_HUGE_VMAP with VM_ALLOW_HUGE_VMAP

Huge page backed vmalloc memory could benefit performance in many cases.
However, some users of vmalloc may not be ready to handle huge pages for
various reasons: hardware constraints, potential pages split, etc.
VM_NO_HUGE_VMAP was introduced to allow vmalloc users to opt-out huge
pages.  However, it is not easy to track down all the users that require
the opt-out, as the allocation are passed different stacks and may cause
issues in different layers.

To address this issue, replace VM_NO_HUGE_VMAP with an opt-in flag,
VM_ALLOW_HUGE_VMAP, so that users that benefit from huge pages could ask
specificially.

Also, remove vmalloc_no_huge() and add opt-in helper vmalloc_huge().

Fixes: db9fe22314a3 ("x86/Kconfig: Select HAVE_ARCH_HUGE_VMALLOC with HAVE_ARCH_HUGE_VMAP")
Link: https://lore.kernel.org/netdev/14444103-d51b-0fb3-ee63-c3f182f0b546@molgen.mpg.de/"
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Song Liu <song@kernel.org>
Reviewed-by: Rik van Riel <riel@surriel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/Kconfig
arch/powerpc/kernel/module.c
arch/s390/kvm/pv.c
include/linux/vmalloc.h
mm/vmalloc.c