HVO no longer refers only to HugeTLB vmemmap optimization. The same optimization is now used more broadly for large compound-page mappings, so the old expansion is too narrow.
Redefine HVO as Hugepage Vmemmap Optimization and update the generic documentation, Kconfig text, and comments accordingly. Signed-off-by: Muchun Song <[email protected]> --- Documentation/admin-guide/kernel-parameters.txt | 2 +- Documentation/admin-guide/mm/hugetlbpage.rst | 4 ++-- Documentation/admin-guide/mm/memory-hotplug.rst | 2 +- Documentation/admin-guide/sysctl/vm.rst | 3 ++- Documentation/mm/vmemmap_dedup.rst | 2 +- fs/Kconfig | 4 ++-- include/linux/mmzone.h | 2 +- mm/Kconfig | 2 +- mm/hugetlb_vmemmap.c | 2 +- mm/hugetlb_vmemmap.h | 2 +- mm/memory-failure.c | 6 +++--- 11 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 0eb64aab3685..2d4cfdcb7535 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -2114,7 +2114,7 @@ Kernel parameters hugetlb_free_vmemmap= [KNL] Requires CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP enabled. - Control if HugeTLB Vmemmap Optimization (HVO) is enabled. + Control if Hugepage Vmemmap Optimization (HVO) for HugeTLB is enabled. Allows heavy hugetlb users to free up some more memory (7 * PAGE_SIZE for each 2MB hugetlb page). Format: { on | off (default) } diff --git a/Documentation/admin-guide/mm/hugetlbpage.rst b/Documentation/admin-guide/mm/hugetlbpage.rst index 67a941903fd2..3f98ca1d7ce1 100644 --- a/Documentation/admin-guide/mm/hugetlbpage.rst +++ b/Documentation/admin-guide/mm/hugetlbpage.rst @@ -172,8 +172,8 @@ 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_OPTIMIZE_VMEMMAP is set, this enables HugeTLB - Vmemmap Optimization (HVO). + When CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP is set, this enables Hugepage + Vmemmap Optimization (HVO) for HugeTLB. When multiple huge page sizes are supported, ``/proc/sys/vm/nr_hugepages`` indicates the current number of pre-allocated huge pages of the default size. diff --git a/Documentation/admin-guide/mm/memory-hotplug.rst b/Documentation/admin-guide/mm/memory-hotplug.rst index 0207f8725142..d5e350607baa 100644 --- a/Documentation/admin-guide/mm/memory-hotplug.rst +++ b/Documentation/admin-guide/mm/memory-hotplug.rst @@ -682,7 +682,7 @@ block might fail: ZONE_MOVABLE for increasing the reliability of gigantic page allocation against the potential loss of hot-unplug reliability. -- Out of memory when dissolving huge pages, especially when HugeTLB Vmemmap +- Out of memory when dissolving huge pages, especially when Hugepage Vmemmap Optimization (HVO) is enabled. Offlining code may be able to migrate huge page contents, but may not be able diff --git a/Documentation/admin-guide/sysctl/vm.rst b/Documentation/admin-guide/sysctl/vm.rst index 97e12359775c..9f333970fdb2 100644 --- a/Documentation/admin-guide/sysctl/vm.rst +++ b/Documentation/admin-guide/sysctl/vm.rst @@ -665,7 +665,8 @@ This knob is not available when the size of 'struct page' (a structure defined in include/linux/mm_types.h) is not power of two (an unusual system config could result in this). -Enable (set to 1) or disable (set to 0) HugeTLB Vmemmap Optimization (HVO). +Enable (set to 1) or disable (set to 0) Hugepage Vmemmap Optimization (HVO) for +HugeTLB. Once enabled, the vmemmap pages of subsequent allocation of HugeTLB pages from buddy allocator will be optimized (7 pages per 2MB HugeTLB page and 4095 pages diff --git a/Documentation/mm/vmemmap_dedup.rst b/Documentation/mm/vmemmap_dedup.rst index 9fa8642ded48..44e80bd2e398 100644 --- a/Documentation/mm/vmemmap_dedup.rst +++ b/Documentation/mm/vmemmap_dedup.rst @@ -8,7 +8,7 @@ A vmemmap diet for HugeTLB and Device DAX HugeTLB ======= -This section is to explain how HugeTLB Vmemmap Optimization (HVO) works. +This section is to explain how Hugepage Vmemmap Optimization (HVO) for HugeTLB works. The ``struct page`` structures are used to describe a physical page frame. By default, there is a one-to-one mapping from a page frame to its corresponding diff --git a/fs/Kconfig b/fs/Kconfig index f6cee1bbb1fc..496cfa2379e5 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -261,11 +261,11 @@ menuconfig HUGETLBFS if HUGETLBFS config HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON - bool "HugeTLB Vmemmap Optimization (HVO) defaults to on" + bool "Hugepage Vmemmap Optimization (HVO) for HugeTLB defaults to on" default n depends on HUGETLB_PAGE_OPTIMIZE_VMEMMAP help - The HugeTLB Vmemmap Optimization (HVO) defaults to off. Say Y here to + The Hugepage Vmemmap Optimization (HVO) for HugeTLB defaults to off. Say Y here to enable HVO by default. It can be disabled via hugetlb_free_vmemmap=off (boot command line) or hugetlb_optimize_vmemmap (sysctl). endif # HUGETLBFS diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 7484e7be7b6d..efb37f2ffec4 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -97,7 +97,7 @@ #define MAX_FOLIO_NR_PAGES (1UL << MAX_FOLIO_ORDER) /* - * HugeTLB Vmemmap Optimization (HVO) requires struct pages of the head page to + * Hugepage Vmemmap Optimization (HVO) requires struct pages of the head page to * be naturally aligned with regard to the folio size. * * HVO which is only active if the size of struct page is a power of 2. diff --git a/mm/Kconfig b/mm/Kconfig index ddd10cb4d0a3..c85ed7d7f37d 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -416,7 +416,7 @@ config SPARSEMEM_VMEMMAP_OPTIMIZATION # # Select this config option from the architecture Kconfig, if it is preferred -# to enable the feature of HugeTLB/dev_dax vmemmap optimization. +# to enable the feature of HVO. # config ARCH_WANT_OPTIMIZE_DAX_VMEMMAP bool diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c index fce772e95adc..6f6f1740f540 100644 --- a/mm/hugetlb_vmemmap.c +++ b/mm/hugetlb_vmemmap.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* - * HugeTLB Vmemmap Optimization (HVO) + * Hugepage Vmemmap Optimization (HVO) for HugeTLB * * Copyright (c) 2020, ByteDance. All rights reserved. * diff --git a/mm/hugetlb_vmemmap.h b/mm/hugetlb_vmemmap.h index 2b0a85e09602..b4d0ba27b42c 100644 --- a/mm/hugetlb_vmemmap.h +++ b/mm/hugetlb_vmemmap.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* - * HugeTLB Vmemmap Optimization (HVO) + * Hugepage Vmemmap Optimization (HVO) for HugeTLB * * Copyright (c) 2020, ByteDance. All rights reserved. * diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 866c4428ac7e..ad6416145667 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -175,9 +175,9 @@ static int __page_handle_poison(struct page *page) /* * zone_pcp_disable() can't be used here. It will * hold pcp_batch_high_lock and dissolve_free_hugetlb_folio() might hold - * cpu_hotplug_lock via static_key_slow_dec() when hugetlb vmemmap - * optimization is enabled. This will break current lock dependency - * chain and leads to deadlock. + * cpu_hotplug_lock via static_key_slow_dec() when HVO for HugeTLB + * is enabled. This will break current lock dependency chain and leads + * to deadlock. * Disabling pcp before dissolving the page was a deterministic * approach because we made sure that those pages cannot end up in any * PCP list. Draining PCP lists expels those pages to the buddy system, -- 2.54.0
