Skip to content

Commit

Permalink
mm: hugetlb_vmemmap: introduce ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP
Browse files Browse the repository at this point in the history
The feature of minimizing overhead of struct page associated with each
HugeTLB page is implemented on x86_64, however, the infrastructure of this
feature is already there, we could easily enable it for other
architectures.  Introduce ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP for other
architectures to be easily enabled.  Just select this config if they want
to enable this feature.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Muchun Song <[email protected]>
Suggested-by: Andrew Morton <[email protected]>
Reviewed-by: Barry Song <[email protected]>
Tested-by: Barry Song <[email protected]>
Reviewed-by: Anshuman Khandual <[email protected]>
Cc: Bodeddula Balasubramaniam <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Fam Zheng <[email protected]>
Cc: James Morse <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Mike Kravetz <[email protected]>
Cc: Oscar Salvador <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Xiongchun Duan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Muchun Song authored and akpm00 committed Apr 29, 2022
1 parent 84448c8 commit 2e4ec02
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions arch/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ config X86
select ARCH_WANTS_NO_INSTR
select ARCH_WANT_GENERAL_HUGETLB
select ARCH_WANT_HUGE_PMD_SHARE
select ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP if X86_64
select ARCH_WANT_LD_ORPHAN_WARN
select ARCH_WANTS_THP_SWAP if X86_64
select ARCH_HAS_PARANOID_L1D_FLUSH
Expand Down
10 changes: 9 additions & 1 deletion fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,17 @@ config HUGETLBFS
config HUGETLB_PAGE
def_bool HUGETLBFS

#
# Select this config option from the architecture Kconfig, if it is preferred
# to enable the feature of minimizing overhead of struct page associated with
# each HugeTLB page.
#
config ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP
bool

config HUGETLB_PAGE_FREE_VMEMMAP
def_bool HUGETLB_PAGE
depends on X86_64
depends on ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP
depends on SPARSEMEM_VMEMMAP

config HUGETLB_PAGE_FREE_VMEMMAP_DEFAULT_ON
Expand Down

0 comments on commit 2e4ec02

Please sign in to comment.