path: root/arch/arm64
diff options
authorHugh Dickins <>2016-05-19 17:13:00 -0700
committerLinus Torvalds <>2016-05-19 19:12:14 -0700
commitfd8cfd3000191cb7f5b9ea8640bd46181f6b4b74 (patch)
tree86c96294eb99388fa70ea420019d2a9e365cf4ca /arch/arm64
parent1d069b7dd56728a0eb6acb138dce0d37600dee00 (diff)
arch: fix has_transparent_hugepage()
I've just discovered that the useful-sounding has_transparent_hugepage() is actually an architecture-dependent minefield: on some arches it only builds if CONFIG_TRANSPARENT_HUGEPAGE=y, on others it's also there when not, but on some of those (arm and arm64) it then gives the wrong answer; and on mips alone it's marked __init, which would crash if called later (but so far it has not been called later). Straighten this out: make it available to all configs, with a sensible default in asm-generic/pgtable.h, removing its definitions from those arches (arc, arm, arm64, sparc, tile) which are served by the default, adding #define has_transparent_hugepage has_transparent_hugepage to those (mips, powerpc, s390, x86) which need to override the default at runtime, and removing the __init from mips (but maybe that kind of code should be avoided after init: set a static variable the first time it's called). Signed-off-by: Hugh Dickins <> Cc: "Kirill A. Shutemov" <> Cc: Andrea Arcangeli <> Cc: Andres Lagar-Cavilla <> Cc: Yang Shi <> Cc: Ning Qu <> Cc: Mel Gorman <> Cc: Konstantin Khlebnikov <> Acked-by: David S. Miller <> Acked-by: Vineet Gupta <> [arch/arc] Acked-by: Gerald Schaefer <> [arch/s390] Acked-by: Ingo Molnar <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'arch/arm64')
1 files changed, 0 insertions, 5 deletions
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index 2da46ae9c991..a7ac45a03dd0 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -314,11 +314,6 @@ static inline int pmd_protnone(pmd_t pmd)
#define set_pmd_at(mm, addr, pmdp, pmd) set_pte_at(mm, addr, (pte_t *)pmdp, pmd_pte(pmd))
-static inline int has_transparent_hugepage(void)
- return 1;
#define __pgprot_modify(prot,mask,bits) \
__pgprot((pgprot_val(prot) & ~(mask)) | (bits))