Commit 562117a9 authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Yang Yingliang
Browse files

mm/vmalloc: Hugepage vmalloc mappings

ascend inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4EUVI
CVE: NA

https://lwn.net/ml/linux-kernel/20200825145753.529284-12-npiggin@gmail.com/



Don't distinction between vmalloc and hugepage vmalloc, because there is no size
print in alloc_large_system_hash in v4.19.

And this patch add page_order in vm_struct, it will break kabi.
--------------

Support huge page vmalloc mappings. Config option HAVE_ARCH_HUGE_VMALLOC
enables support on architectures that define HAVE_ARCH_HUGE_VMAP and
supports PMD sized vmap mappings.

vmalloc will attempt to allocate PMD-sized pages if allocating PMD size or
larger, and fall back to small pages if that was unsuccessful.

Allocations that do not use PAGE_KERNEL prot are not permitted to use huge
pages, because not all callers expect this (e.g., module allocations vs
strict module rwx).

This reduces TLB misses by nearly 30x on a `git diff` workload on a 2-node
POWER9 (59,800 -> 2,100) and reduces CPU cycles by 0.54%.

This can result in more internal fragmentation and memory overhead for a
given allocation, an option nohugevmalloc is added to disable at boot.

Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarRui Xiang <rui.xiang@huawei.com>
Reviewed-by: default avatarDing Tianhong <dingtianhong@huawei.com>
Reviewed-by: default avatarZefan Li <lizefan@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarWeilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 3eb01fae
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment