mm: generalize SYS_SUPPORTS_HUGETLBFS (rename as ARCH_SUPPORTS_HUGETLBFS)
authorAnshuman Khandual <anshuman.khandual@arm.com>
Wed, 5 May 2021 01:38:13 +0000 (18:38 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 5 May 2021 18:27:25 +0000 (11:27 -0700)
SYS_SUPPORTS_HUGETLBFS config has duplicate definitions on platforms
that subscribe it.  Instead, just make it a generic option which can be
selected on applicable platforms.

Also rename it as ARCH_SUPPORTS_HUGETLBFS instead.  This reduces code
duplication and makes it cleaner.

Link: https://lkml.kernel.org/r/1617259448-22529-3-git-send-email-anshuman.khandual@arm.com
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com> [arm64]
Acked-by: Palmer Dabbelt <palmerdabbelt@google.com> [riscv]
Acked-by: Michael Ellerman <mpe@ellerman.id.au> [powerpc]
Cc: Russell King <linux@armlinux.org.uk>
Cc: Will Deacon <will@kernel.org>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/arm/Kconfig
arch/arm64/Kconfig
arch/mips/Kconfig
arch/parisc/Kconfig
arch/powerpc/Kconfig
arch/powerpc/platforms/Kconfig.cputype
arch/riscv/Kconfig
arch/sh/Kconfig
fs/Kconfig

index 085c830d344bdf875eb944f15eee39a97facccff..13fa7ecf195c14b8e26d0b1e5237d23e826dae03 100644 (file)
@@ -31,6 +31,7 @@ config ARM
        select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
        select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if CPU_V7
        select ARCH_SUPPORTS_ATOMIC_RMW
+       select ARCH_SUPPORTS_HUGETLBFS if ARM_LPAE
        select ARCH_USE_BUILTIN_BSWAP
        select ARCH_USE_CMPXCHG_LOCKREF
        select ARCH_USE_MEMTEST
@@ -1511,10 +1512,6 @@ config HW_PERF_EVENTS
        def_bool y
        depends on ARM_PMU
 
-config SYS_SUPPORTS_HUGETLBFS
-       def_bool y
-       depends on ARM_LPAE
-
 config HAVE_ARCH_TRANSPARENT_HUGEPAGE
        def_bool y
        depends on ARM_LPAE
index 86dfaac79e490e0836914d170781ccda6eb147f6..0fd5d373d7cfda884d5533ee2fd8e358fb4b29a4 100644 (file)
@@ -73,6 +73,7 @@ config ARM64
        select ARCH_USE_QUEUED_SPINLOCKS
        select ARCH_USE_SYM_ANNOTATIONS
        select ARCH_SUPPORTS_DEBUG_PAGEALLOC
+       select ARCH_SUPPORTS_HUGETLBFS
        select ARCH_SUPPORTS_MEMORY_FAILURE
        select ARCH_SUPPORTS_SHADOW_CALL_STACK if CC_HAVE_SHADOW_CALL_STACK
        select ARCH_SUPPORTS_LTO_CLANG if CPU_LITTLE_ENDIAN
@@ -1072,9 +1073,6 @@ config HW_PERF_EVENTS
        def_bool y
        depends on ARM_PMU
 
-config SYS_SUPPORTS_HUGETLBFS
-       def_bool y
-
 config ARCH_HAS_FILTER_PGPROT
        def_bool y
 
index 49a3c9cd1cb296938b706c062991ea08a9e21d7c..ed51970c08e75c683e1872261cd2152f4546e101 100644 (file)
@@ -19,6 +19,7 @@ config MIPS
        select ARCH_USE_MEMTEST
        select ARCH_USE_QUEUED_RWLOCKS
        select ARCH_USE_QUEUED_SPINLOCKS
+       select ARCH_SUPPORTS_HUGETLBFS if CPU_SUPPORTS_HUGEPAGES
        select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
        select ARCH_WANT_IPC_PARSE_VERSION
        select ARCH_WANT_LD_ORPHAN_WARN
@@ -1287,11 +1288,6 @@ config SYS_SUPPORTS_BIG_ENDIAN
 config SYS_SUPPORTS_LITTLE_ENDIAN
        bool
 
-config SYS_SUPPORTS_HUGETLBFS
-       bool
-       depends on CPU_SUPPORTS_HUGEPAGES
-       default y
-
 config MIPS_HUGE_TLB_SUPPORT
        def_bool HUGETLB_PAGE || TRANSPARENT_HUGEPAGE
 
index afc3b8d03572684d649e7fe82ef88839c0e0714e..bde9907bc5b25f91851266b6be92832937cb3f94 100644 (file)
@@ -12,6 +12,7 @@ config PARISC
        select ARCH_HAS_STRICT_KERNEL_RWX
        select ARCH_HAS_UBSAN_SANITIZE_ALL
        select ARCH_NO_SG_CHAIN
+       select ARCH_SUPPORTS_HUGETLBFS if PA20
        select ARCH_SUPPORTS_MEMORY_FAILURE
        select DMA_OPS
        select RTC_CLASS
@@ -138,10 +139,6 @@ config PGTABLE_LEVELS
        default 3 if 64BIT && PARISC_PAGE_SIZE_4KB
        default 2
 
-config SYS_SUPPORTS_HUGETLBFS
-       def_bool y if PA20
-
-
 menu "Processor type and features"
 
 choice
index 965278498dd7c8fd5f1a484a6e035baf04bba0b8..3a2b90e21e690b274335c9be54aa4e9273e38e17 100644 (file)
@@ -697,9 +697,6 @@ config ARCH_SPARSEMEM_DEFAULT
        def_bool y
        depends on PPC_BOOK3S_64
 
-config SYS_SUPPORTS_HUGETLBFS
-       bool
-
 config ILLEGAL_POINTER_VALUE
        hex
        # This is roughly half way between the top of user space and the bottom
index 3ce907523b1e16611470298c39c85bbb9a75f234..cec1017813f8a342cc45dffa32d53b5ee2c3d49d 100644 (file)
@@ -40,8 +40,8 @@ config PPC_85xx
 
 config PPC_8xx
        bool "Freescale 8xx"
+       select ARCH_SUPPORTS_HUGETLBFS
        select FSL_SOC
-       select SYS_SUPPORTS_HUGETLBFS
        select PPC_HAVE_KUEP
        select PPC_HAVE_KUAP
        select HAVE_ARCH_VMAP_STACK
@@ -95,9 +95,9 @@ config PPC_BOOK3S_64
        bool "Server processors"
        select PPC_FPU
        select PPC_HAVE_PMU_SUPPORT
-       select SYS_SUPPORTS_HUGETLBFS
        select HAVE_ARCH_TRANSPARENT_HUGEPAGE
        select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE
+       select ARCH_SUPPORTS_HUGETLBFS
        select ARCH_SUPPORTS_NUMA_BALANCING
        select IRQ_WORK
        select PPC_MM_SLICES
@@ -278,9 +278,9 @@ config FSL_BOOKE
 # this is for common code between PPC32 & PPC64 FSL BOOKE
 config PPC_FSL_BOOK3E
        bool
+       select ARCH_SUPPORTS_HUGETLBFS if PHYS_64BIT || PPC64
        select FSL_EMB_PERFMON
        select PPC_SMP_MUXED_IPI
-       select SYS_SUPPORTS_HUGETLBFS if PHYS_64BIT || PPC64
        select PPC_DOORBELL
        default y if FSL_BOOKE
 
index 4515a10c5d222e18774d4cc545501b3e09f88464..2a0fc12b8d4503eddda3c9f893fa96bb266d67da 100644 (file)
@@ -30,6 +30,7 @@ config RISCV
        select ARCH_HAS_STRICT_KERNEL_RWX if MMU
        select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
        select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
+       select ARCH_SUPPORTS_HUGETLBFS if MMU
        select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
        select ARCH_WANT_FRAME_POINTERS
        select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
@@ -165,10 +166,6 @@ config ARCH_WANT_GENERAL_HUGETLB
 config ARCH_SUPPORTS_UPROBES
        def_bool y
 
-config SYS_SUPPORTS_HUGETLBFS
-       depends on MMU
-       def_bool y
-
 config STACKTRACE_SUPPORT
        def_bool y
 
index e798e55915c2337f875a525fbeb8db58400c31ad..a54b0c5de37bb492fcd74ea53bc8473cb66080d8 100644 (file)
@@ -101,9 +101,6 @@ config SYS_SUPPORTS_APM_EMULATION
        bool
        select ARCH_SUSPEND_POSSIBLE
 
-config SYS_SUPPORTS_HUGETLBFS
-       bool
-
 config SYS_SUPPORTS_SMP
        bool
 
@@ -175,12 +172,12 @@ config CPU_SH3
 
 config CPU_SH4
        bool
+       select ARCH_SUPPORTS_HUGETLBFS if MMU
        select CPU_HAS_INTEVT
        select CPU_HAS_SR_RB
        select CPU_HAS_FPU if !CPU_SH4AL_DSP
        select SH_INTC
        select SYS_SUPPORTS_SH_TMU
-       select SYS_SUPPORTS_HUGETLBFS if MMU
 
 config CPU_SH4A
        bool
index 97e7b77c93094fd3dbb58c2b66f5989b573720b1..89a750d292baf48e8e51278769496cc663272d21 100644 (file)
@@ -223,10 +223,13 @@ config TMPFS_INODE64
 
          If unsure, say N.
 
+config ARCH_SUPPORTS_HUGETLBFS
+       def_bool n
+
 config HUGETLBFS
        bool "HugeTLB file system support"
        depends on X86 || IA64 || SPARC64 || (S390 && 64BIT) || \
-                  SYS_SUPPORTS_HUGETLBFS || BROKEN
+                  ARCH_SUPPORTS_HUGETLBFS || BROKEN
        help
          hugetlbfs is a filesystem backing for HugeTLB pages, based on
          ramfs. For architectures that support it, say Y here and read