s390/mm: add support to allocate gigantic hugepages using CMA
authorGerald Schaefer <gerald.schaefer@linux.ibm.com>
Tue, 8 Dec 2020 18:47:15 +0000 (19:47 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Thu, 10 Dec 2020 20:11:01 +0000 (21:11 +0100)
Commit cf11e85fc08c ("mm: hugetlb: optionally allocate gigantic hugepages
using cma") added support for allocating gigantic hugepages using CMA,
by specifying the hugetlb_cma= kernel parameter, which will disable any
boot-time allocation of gigantic hugepages.

This patch enables that option also for s390.

Signed-off-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/kernel/setup.c

index 756936785598c82fabfd22e283c1b991d3b275b8..1f16a03be995be95db7ae72b247c992d98988957 100644 (file)
@@ -49,6 +49,7 @@
 #include <linux/memory.h>
 #include <linux/compat.h>
 #include <linux/start_kernel.h>
+#include <linux/hugetlb.h>
 
 #include <asm/boot_data.h>
 #include <asm/ipl.h>
@@ -1146,6 +1147,8 @@ void __init setup_arch(char **cmdline_p)
        setup_memory();
        dma_contiguous_reserve(ident_map_size);
        vmcp_cma_reserve();
+       if (MACHINE_HAS_EDAT2)
+               hugetlb_cma_reserve(PUD_SHIFT - PAGE_SHIFT);
 
        check_initrd();
        reserve_crashkernel();