sh: advertise gigantic page support

Patch series "Fix free/allocation of runtime gigantic pages", v8.

This series fixes sh and sparc that did not advertise their gigantic page
support and then were not able to allocate and free those pages at
runtime.  It renames MEMORY_ISOLATION && COMPACTION || CMA condition into
the more accurate CONTIG_ALLOC, since it allows the definition of
alloc_contig_range function.

Finally, it then fixes the wrong definition of ARCH_HAS_GIGANTIC_PAGE
config that, without MEMORY_ISOLATION && COMPACTION || CMA defined, did
not allow architectures to free boottime allocated gigantic pages although

This patch (of 4):

sh actually supports gigantic pages and selecting ARCH_HAS_GIGANTIC_PAGE
allows it to allocate and free gigantic pages at runtime.

At least sdk7786_defconfig exposes such a configuration with huge pages of
64MB, pages of 4KB and MAX_ORDER = 11: HPAGE_SHIFT (26) - PAGE_SHIFT (12)
= 14 >= MAX_ORDER (11)

Signed-off-by: Alexandre Ghiti <>
Reviewed-by: Andrew Morton <>
Cc: Aneesh Kumar K.V <>
Cc: Michael Ellerman <>
Cc: Vlastimil Babka <>
Cc: Catalin Marinas <>
Cc: Will Deacon <>
Cc: Benjamin Herrenschmidt <>
Cc: Paul Mackerras <>
Cc: Martin Schwidefsky <>
Cc: Heiko Carstens <>
Cc: Yoshinori Sato <>
Cc: Rich Felker <>
Cc: David S. Miller <>
Cc: Thomas Gleixner <>
Cc: Ingo Molnar <>
Cc: Borislav Petkov <>
Cc: "H . Peter Anvin" <>
Cc: Dave Hansen <>
Cc: Andy Lutomirsky <>
Cc: Peter Zijlstra <>
Cc: Mike Kravetz <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
1 file changed