summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Ghiti <alex@ghiti.fr>2019-05-13 20:19:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-14 12:47:47 -0400
commit8df995f6bde01de96ce93373785f41c3bd13ad1c (patch)
tree77c057bcd9f0d1eb82b731043a8cc21ce3e41c59
parentb53f45695449f692d5d2ab89cecc3316cdb636e8 (diff)
mm: simplify MEMORY_ISOLATION && COMPACTION || CMA into CONTIG_ALLOC
This condition allows to define alloc_contig_range, so simplify it into a more accurate naming. Link: http://lkml.kernel.org/r/20190327063626.18421-4-alex@ghiti.fr Signed-off-by: Alexandre Ghiti <alex@ghiti.fr> Suggested-by: Vlastimil Babka <vbabka@suse.cz> Acked-by: Vlastimil Babka <vbabka@suse.cz> Cc: Andy Lutomirsky <luto@kernel.org> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: David S. Miller <davem@davemloft.net> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: "H . Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Mike Kravetz <mike.kravetz@oracle.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rich Felker <dalias@libc.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Will Deacon <will.deacon@arm.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/arm64/Kconfig2
-rw-r--r--arch/powerpc/platforms/Kconfig.cputype2
-rw-r--r--arch/s390/Kconfig2
-rw-r--r--arch/sh/Kconfig2
-rw-r--r--arch/sparc/Kconfig2
-rw-r--r--arch/x86/Kconfig2
-rw-r--r--arch/x86/mm/hugetlbpage.c2
-rw-r--r--include/linux/gfp.h2
-rw-r--r--mm/Kconfig3
-rw-r--r--mm/page_alloc.c3
10 files changed, 12 insertions, 10 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index e24dc16453aa..7f7fbd8bd9d5 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -19,7 +19,7 @@ config ARM64
19 select ARCH_HAS_FAST_MULTIPLIER 19 select ARCH_HAS_FAST_MULTIPLIER
20 select ARCH_HAS_FORTIFY_SOURCE 20 select ARCH_HAS_FORTIFY_SOURCE
21 select ARCH_HAS_GCOV_PROFILE_ALL 21 select ARCH_HAS_GCOV_PROFILE_ALL
22 select ARCH_HAS_GIGANTIC_PAGE if (MEMORY_ISOLATION && COMPACTION) || CMA 22 select ARCH_HAS_GIGANTIC_PAGE if CONTIG_ALLOC
23 select ARCH_HAS_KCOV 23 select ARCH_HAS_KCOV
24 select ARCH_HAS_KEEPINITRD 24 select ARCH_HAS_KEEPINITRD
25 select ARCH_HAS_MEMBARRIER_SYNC_CORE 25 select ARCH_HAS_MEMBARRIER_SYNC_CORE
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index d0e172d47574..3a31d4289ea4 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -331,7 +331,7 @@ config ARCH_ENABLE_SPLIT_PMD_PTLOCK
331config PPC_RADIX_MMU 331config PPC_RADIX_MMU
332 bool "Radix MMU Support" 332 bool "Radix MMU Support"
333 depends on PPC_BOOK3S_64 && HUGETLB_PAGE 333 depends on PPC_BOOK3S_64 && HUGETLB_PAGE
334 select ARCH_HAS_GIGANTIC_PAGE if (MEMORY_ISOLATION && COMPACTION) || CMA 334 select ARCH_HAS_GIGANTIC_PAGE if CONTIG_ALLOC
335 select PPC_HAVE_KUEP 335 select PPC_HAVE_KUEP
336 select PPC_HAVE_KUAP 336 select PPC_HAVE_KUAP
337 default y 337 default y
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 07485582d027..724dbc6b7d33 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -63,7 +63,7 @@ config S390
63 select ARCH_HAS_ELF_RANDOMIZE 63 select ARCH_HAS_ELF_RANDOMIZE
64 select ARCH_HAS_FORTIFY_SOURCE 64 select ARCH_HAS_FORTIFY_SOURCE
65 select ARCH_HAS_GCOV_PROFILE_ALL 65 select ARCH_HAS_GCOV_PROFILE_ALL
66 select ARCH_HAS_GIGANTIC_PAGE if (MEMORY_ISOLATION && COMPACTION) || CMA 66 select ARCH_HAS_GIGANTIC_PAGE if CONTIG_ALLOC
67 select ARCH_HAS_KCOV 67 select ARCH_HAS_KCOV
68 select ARCH_HAS_PTE_SPECIAL 68 select ARCH_HAS_PTE_SPECIAL
69 select ARCH_HAS_SET_MEMORY 69 select ARCH_HAS_SET_MEMORY
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 6349396317a9..2a5ec643fec0 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -53,7 +53,7 @@ config SUPERH
53 select HAVE_FUTEX_CMPXCHG if FUTEX 53 select HAVE_FUTEX_CMPXCHG if FUTEX
54 select HAVE_NMI 54 select HAVE_NMI
55 select NEED_SG_DMA_LENGTH 55 select NEED_SG_DMA_LENGTH
56 select ARCH_HAS_GIGANTIC_PAGE if (MEMORY_ISOLATION && COMPACTION) || CMA 56 select ARCH_HAS_GIGANTIC_PAGE if CONTIG_ALLOC
57 57
58 help 58 help
59 The SuperH is a RISC processor targeted for use in embedded systems 59 The SuperH is a RISC processor targeted for use in embedded systems
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index b848c8ddd92e..566de738e487 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -92,7 +92,7 @@ config SPARC64
92 select ARCH_CLOCKSOURCE_DATA 92 select ARCH_CLOCKSOURCE_DATA
93 select ARCH_HAS_PTE_SPECIAL 93 select ARCH_HAS_PTE_SPECIAL
94 select PCI_DOMAINS if PCI 94 select PCI_DOMAINS if PCI
95 select ARCH_HAS_GIGANTIC_PAGE if (MEMORY_ISOLATION && COMPACTION) || CMA 95 select ARCH_HAS_GIGANTIC_PAGE if CONTIG_ALLOC
96 96
97config ARCH_DEFCONFIG 97config ARCH_DEFCONFIG
98 string 98 string
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index e7212731cffb..526d95abfe5e 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -22,7 +22,7 @@ config X86_64
22 def_bool y 22 def_bool y
23 depends on 64BIT 23 depends on 64BIT
24 # Options that are inherently 64-bit kernel only: 24 # Options that are inherently 64-bit kernel only:
25 select ARCH_HAS_GIGANTIC_PAGE if (MEMORY_ISOLATION && COMPACTION) || CMA 25 select ARCH_HAS_GIGANTIC_PAGE if CONTIG_ALLOC
26 select ARCH_SUPPORTS_INT128 26 select ARCH_SUPPORTS_INT128
27 select ARCH_USE_CMPXCHG_LOCKREF 27 select ARCH_USE_CMPXCHG_LOCKREF
28 select HAVE_ARCH_SOFT_DIRTY 28 select HAVE_ARCH_SOFT_DIRTY
diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
index 92e4c4b85bba..fab095362c50 100644
--- a/arch/x86/mm/hugetlbpage.c
+++ b/arch/x86/mm/hugetlbpage.c
@@ -203,7 +203,7 @@ static __init int setup_hugepagesz(char *opt)
203} 203}
204__setup("hugepagesz=", setup_hugepagesz); 204__setup("hugepagesz=", setup_hugepagesz);
205 205
206#if (defined(CONFIG_MEMORY_ISOLATION) && defined(CONFIG_COMPACTION)) || defined(CONFIG_CMA) 206#ifdef CONFIG_CONTIG_ALLOC
207static __init int gigantic_pages_init(void) 207static __init int gigantic_pages_init(void)
208{ 208{
209 /* With compaction or CMA we can allocate gigantic pages at runtime */ 209 /* With compaction or CMA we can allocate gigantic pages at runtime */
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index fdab7de7490d..e77ab30e9328 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -585,7 +585,7 @@ static inline bool pm_suspended_storage(void)
585} 585}
586#endif /* CONFIG_PM_SLEEP */ 586#endif /* CONFIG_PM_SLEEP */
587 587
588#if (defined(CONFIG_MEMORY_ISOLATION) && defined(CONFIG_COMPACTION)) || defined(CONFIG_CMA) 588#ifdef CONFIG_CONTIG_ALLOC
589/* The below functions must be run on a range from a single zone. */ 589/* The below functions must be run on a range from a single zone. */
590extern int alloc_contig_range(unsigned long start, unsigned long end, 590extern int alloc_contig_range(unsigned long start, unsigned long end,
591 unsigned migratetype, gfp_t gfp_mask); 591 unsigned migratetype, gfp_t gfp_mask);
diff --git a/mm/Kconfig b/mm/Kconfig
index 25c71eb8a7db..137eadc18732 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -258,6 +258,9 @@ config ARCH_ENABLE_HUGEPAGE_MIGRATION
258config ARCH_ENABLE_THP_MIGRATION 258config ARCH_ENABLE_THP_MIGRATION
259 bool 259 bool
260 260
261config CONTIG_ALLOC
262 def_bool (MEMORY_ISOLATION && COMPACTION) || CMA
263
261config PHYS_ADDR_T_64BIT 264config PHYS_ADDR_T_64BIT
262 def_bool 64BIT 265 def_bool 64BIT
263 266
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 07a0d722d481..2efb6525d932 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -8137,8 +8137,7 @@ unmovable:
8137 return true; 8137 return true;
8138} 8138}
8139 8139
8140#if (defined(CONFIG_MEMORY_ISOLATION) && defined(CONFIG_COMPACTION)) || defined(CONFIG_CMA) 8140#ifdef CONFIG_CONTIG_ALLOC
8141
8142static unsigned long pfn_max_align_down(unsigned long pfn) 8141static unsigned long pfn_max_align_down(unsigned long pfn)
8143{ 8142{
8144 return pfn & ~(max_t(unsigned long, MAX_ORDER_NR_PAGES, 8143 return pfn & ~(max_t(unsigned long, MAX_ORDER_NR_PAGES,