All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] riscv: Add support to allocate gigantic hugepages using CMA
@ 2021-07-30 12:48 Kefeng Wang
  2021-08-14  5:00 ` Palmer Dabbelt
  0 siblings, 1 reply; 2+ messages in thread
From: Kefeng Wang @ 2021-07-30 12:48 UTC (permalink / raw)
  To: Palmer Dabbelt, linux-riscv
  Cc: palmerdabbelt, paul.walmsley, aou, Kefeng Wang, Alexandre Ghiti

Commit 9e953cda5cdf ("riscv: Introduce huge page support for32/64bit
kernel") adds support gigantic hugepage support for RV64.

This patch adds support to allocate gigantic hugepages using CMA by
specifying the hugetlb_cma= kernel parameter on RV64.

Cc: Alexandre Ghiti <alex@ghiti.fr>
Reviewed-by: Alexandre Ghiti <alex@ghiti.fr>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
v3: Update changelog and add Reviewed-by.
 arch/riscv/mm/init.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index a14bf3910eec..e547e53cddd2 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -19,6 +19,7 @@
 #include <linux/set_memory.h>
 #include <linux/dma-map-ops.h>
 #include <linux/crash_dump.h>
+#include <linux/hugetlb.h>
 
 #include <asm/fixmap.h>
 #include <asm/tlbflush.h>
@@ -216,6 +217,8 @@ static void __init setup_bootmem(void)
 
 	early_init_fdt_scan_reserved_mem();
 	dma_contiguous_reserve(dma32_phys_limit);
+	if (IS_ENABLED(CONFIG_64BIT))
+		hugetlb_cma_reserve(PUD_SHIFT - PAGE_SHIFT);
 	memblock_allow_resize();
 }
 
-- 
2.26.2


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] riscv: Add support to allocate gigantic hugepages using CMA
  2021-07-30 12:48 [PATCH v3] riscv: Add support to allocate gigantic hugepages using CMA Kefeng Wang
@ 2021-08-14  5:00 ` Palmer Dabbelt
  0 siblings, 0 replies; 2+ messages in thread
From: Palmer Dabbelt @ 2021-08-14  5:00 UTC (permalink / raw)
  To: wangkefeng.wang; +Cc: linux-riscv, Paul Walmsley, aou, wangkefeng.wang, alex

On Fri, 30 Jul 2021 05:48:41 PDT (-0700), wangkefeng.wang@huawei.com wrote:
> Commit 9e953cda5cdf ("riscv: Introduce huge page support for32/64bit
> kernel") adds support gigantic hugepage support for RV64.
>
> This patch adds support to allocate gigantic hugepages using CMA by
> specifying the hugetlb_cma= kernel parameter on RV64.
>
> Cc: Alexandre Ghiti <alex@ghiti.fr>
> Reviewed-by: Alexandre Ghiti <alex@ghiti.fr>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> v3: Update changelog and add Reviewed-by.
>  arch/riscv/mm/init.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index a14bf3910eec..e547e53cddd2 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -19,6 +19,7 @@
>  #include <linux/set_memory.h>
>  #include <linux/dma-map-ops.h>
>  #include <linux/crash_dump.h>
> +#include <linux/hugetlb.h>
>
>  #include <asm/fixmap.h>
>  #include <asm/tlbflush.h>
> @@ -216,6 +217,8 @@ static void __init setup_bootmem(void)
>
>  	early_init_fdt_scan_reserved_mem();
>  	dma_contiguous_reserve(dma32_phys_limit);
> +	if (IS_ENABLED(CONFIG_64BIT))
> +		hugetlb_cma_reserve(PUD_SHIFT - PAGE_SHIFT);
>  	memblock_allow_resize();
>  }

Thanks.  This is on for-next.  I cleaned up the commit text a bit.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-14  5:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-30 12:48 [PATCH v3] riscv: Add support to allocate gigantic hugepages using CMA Kefeng Wang
2021-08-14  5:00 ` Palmer Dabbelt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.