aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnshuman Khandual <anshuman.khandual@arm.com>2021-05-11 15:06:01 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2021-05-11 15:06:01 +1000
commit07f9193834d0574e4b0ff93b6d3b674c9534bf7d (patch)
tree134f2e89a1b704453dce9a47783eb69d00ace008
parent3f5a13001fd54026527807d3185ede4703fd8d04 (diff)
downloadlinux-next-07f9193834d0574e4b0ff93b6d3b674c9534bf7d.tar.gz
mm/thp: make ALLOC_SPLIT_PTLOCKS dependent on USE_SPLIT_PTE_PTLOCKS
Notice: this object is not reachable from any branch.
Split ptlocks need not be defined and allocated unless they are being used. ALLOC_SPLIT_PTLOCKS is inherently dependent on USE_SPLIT_PTE_PTLOCKS. This just makes it explicit and clear. Link: https://lkml.kernel.org/r/1620618390-9999-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Notice: this object is not reachable from any branch.
-rw-r--r--include/linux/mm_types_task.h5
-rw-r--r--mm/memory.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/mm_types_task.h b/include/linux/mm_types_task.h
index c1bc6731125cb..1b222f8039d10 100644
--- a/include/linux/mm_types_task.h
+++ b/include/linux/mm_types_task.h
@@ -22,7 +22,12 @@
#define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS)
#define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \
IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK))
+
+#if USE_SPLIT_PTE_PTLOCKS
#define ALLOC_SPLIT_PTLOCKS (SPINLOCK_SIZE > BITS_PER_LONG/8)
+#else
+#define ALLOC_SPLIT_PTLOCKS 0
+#endif
/*
* The per task VMA cache array:
diff --git a/mm/memory.c b/mm/memory.c
index c64dd8db0c004..f814fa8e9c563 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -5260,7 +5260,7 @@ long copy_huge_page_from_user(struct page *dst_page,
}
#endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */
-#if USE_SPLIT_PTE_PTLOCKS && ALLOC_SPLIT_PTLOCKS
+#if ALLOC_SPLIT_PTLOCKS
static struct kmem_cache *page_ptl_cachep;