Commit 0b6f1582 authored by Aneesh Kumar K.V's avatar Aneesh Kumar K.V Committed by Andrew Morton
Browse files

mm/vmemmap optimization: split hugetlb and devdax vmemmap optimization

Arm disabled hugetlb vmemmap optimization [1] because hugetlb vmemmap
optimization includes an update of both the permissions (writeable to
read-only) and the output address (pfn) of the vmemmap ptes.  That is not
supported without unmapping of pte(marking it invalid) by some
architectures.

With DAX vmemmap optimization we don't require such pte updates and
architectures can enable DAX vmemmap optimization while having hugetlb
vmemmap optimization disabled.  Hence split DAX optimization support into
a different config.

s390, loongarch and riscv don't have devdax support.  So the DAX config is
not enabled for them.  With this change, arm64 should be able to select
DAX optimization

[1] commit 060a2c92 ("arm64: mm: hugetlb: Disable HUGETLB_PAGE_OPTIMIZE_VMEMMAP")

Link: https://lkml.kernel.org/r/20230724190759.483013-8-aneesh.kumar@linux.ibm.com


Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Joao Martins <joao.m.martins@oracle.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 54a948a1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ config LOONGARCH
	select ARCH_USE_QUEUED_SPINLOCKS
	select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
	select ARCH_WANT_LD_ORPHAN_WARN
	select ARCH_WANT_OPTIMIZE_VMEMMAP
	select ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP
	select ARCH_WANTS_NO_INSTR
	select BUILDTIME_TABLE_SORT
	select COMMON_CLK
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ config RISCV
	select ARCH_WANT_GENERAL_HUGETLB if !RISCV_ISA_SVNAPOT
	select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
	select ARCH_WANT_LD_ORPHAN_WARN if !XIP_KERNEL
	select ARCH_WANT_OPTIMIZE_VMEMMAP
	select ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP
	select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE
	select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU
	select BUILDTIME_TABLE_SORT if MMU
+1 −1
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ config S390
	select ARCH_WANTS_NO_INSTR
	select ARCH_WANT_DEFAULT_BPF_JIT
	select ARCH_WANT_IPC_PARSE_VERSION
	select ARCH_WANT_OPTIMIZE_VMEMMAP
	select ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP
	select BUILDTIME_TABLE_SORT
	select CLONE_BACKWARDS2
	select DMA_OPS if PCI
+2 −1
Original line number Diff line number Diff line
@@ -128,7 +128,8 @@ config X86
	select ARCH_WANT_GENERAL_HUGETLB
	select ARCH_WANT_HUGE_PMD_SHARE
	select ARCH_WANT_LD_ORPHAN_WARN
	select ARCH_WANT_OPTIMIZE_VMEMMAP	if X86_64
	select ARCH_WANT_OPTIMIZE_DAX_VMEMMAP	if X86_64
	select ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP	if X86_64
	select ARCH_WANTS_THP_SWAP		if X86_64
	select ARCH_HAS_PARANOID_L1D_FLUSH
	select BUILDTIME_TABLE_SORT
+1 −1
Original line number Diff line number Diff line
@@ -254,7 +254,7 @@ config HUGETLB_PAGE

config HUGETLB_PAGE_OPTIMIZE_VMEMMAP
	def_bool HUGETLB_PAGE
	depends on ARCH_WANT_OPTIMIZE_VMEMMAP
	depends on ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP
	depends on SPARSEMEM_VMEMMAP

config HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON
Loading