Commit f1f5face authored by Muchun Song's avatar Muchun Song Committed by Zheng Zengkai
Browse files

mm: hugetlb_vmemmap: cleanup CONFIG_HUGETLB_PAGE_FREE_VMEMMAP*

mainline inclusion
from mainline-v5.19-rc1
commit 47010c04
category: feature
bugzilla: 187198, https://gitee.com/openeuler/kernel/issues/I5GVFO
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=47010c040dec8af6347ec6259104fc13f7e7e30a

--------------------------------

The word of "free" is not expressive enough to express the feature of
optimizing vmemmap pages associated with each HugeTLB, rename this keywork
to "optimize".  In this patch , cheanup configs to make code more
expressive.

Link: https://lkml.kernel.org/r/20220404074652.68024-4-songmuchun@bytedance.com


Signed-off-by: default avatarMuchun Song <songmuchun@bytedance.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: David Hildenbrand <david@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Conflicts:
	arch/arm64/configs/openeuler_defconfig
	arch/x86/configs/openeuler_defconfig
	Documentation/admin-guide/kernel-parameters.txt
	include/linux/hugetlb.h
	mm/Makefile
Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 142ca734
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1593,7 +1593,7 @@
			Format: size[KMG]

	hugetlb_free_vmemmap=
			[KNL] Reguires CONFIG_HUGETLB_PAGE_FREE_VMEMMAP
			[KNL] Reguires CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP
			enabled.
			Allows heavy hugetlb users to free up some more
			memory (7 * PAGE_SIZE for each 2MB hugetlb page).
@@ -1602,6 +1602,9 @@
			on:  enable the feature
			off: disable the feature

			Built with CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON=y,
			the default is on.

	hugevmalloc	[KNL,PPC,ARM64,X86] Requires CONFIG_HAVE_ARCH_HUGE_VMALLOC
			Format: { on | off }
			Default set by CONFIG_HUGE_VMALLOC_DEFAULT_ENABLED.
+1 −1
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@ default_hugepagesz
	will all result in 256 2M huge pages being allocated.  Valid default
	huge page size is architecture dependent.
hugetlb_free_vmemmap
	When CONFIG_HUGETLB_PAGE_FREE_VMEMMAP is set, this enables freeing
	When CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP is set, this enables optimizing
	unused vmemmap pages associated with each HugeTLB page.

When multiple huge page sizes are supported, ``/proc/sys/vm/nr_hugepages``
+1 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ config ARM64
	select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
	select ARCH_WANT_FRAME_POINTERS
	select ARCH_WANT_HUGE_PMD_SHARE if ARM64_4K_PAGES || (ARM64_16K_PAGES && !ARM64_VA_BITS_36)
	select ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP
	select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP
	select ARCH_WANT_LD_ORPHAN_WARN
	select ARCH_WANT_RESERVE_CRASH_KERNEL if KEXEC_CORE
	select ARCH_HAS_UBSAN_SANITIZE_ALL
+2 −2
Original line number Diff line number Diff line
@@ -6281,8 +6281,8 @@ CONFIG_TMPFS_XATTR=y
# CONFIG_TMPFS_INODE64 is not set
CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y
CONFIG_HUGETLB_PAGE_FREE_VMEMMAP=y
# CONFIG_HUGETLB_PAGE_FREE_VMEMMAP_DEFAULT_ON is not set
CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP=y
# CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON is not set
CONFIG_MEMFD_CREATE=y
CONFIG_ARCH_HAS_GIGANTIC_PAGE=y
CONFIG_CONFIGFS_FS=y
+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ void flush_dcache_page(struct page *page)
	/*
	 * Only the head page's flags of HugeTLB can be cleared since the tail
	 * vmemmap pages associated with each HugeTLB page are mapped with
	 * read-only when CONFIG_HUGETLB_PAGE_FREE_VMEMMAP is enabled (more
	 * read-only when CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP is enabled (more
	 * details can refer to vmemmap_remap_pte()).  Although
	 * __sync_icache_dcache() only set PG_dcache_clean flag on the head
	 * page struct, there is more than one page struct with PG_dcache_clean
Loading