linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: mm: hugetlb: add support for free vmemmap pages of HugeTLB
@ 2021-05-18  9:18 Muchun Song
  2021-05-19 11:45 ` Anshuman Khandual
  2021-05-19 12:36 ` Anshuman Khandual
  0 siblings, 2 replies; 13+ messages in thread
From: Muchun Song @ 2021-05-18  9:18 UTC (permalink / raw)
  To: will, akpm, david, bodeddub, osalvador, mike.kravetz, rientjes
  Cc: linux-arm-kernel, linux-kernel, linux-mm, duanxiongchun,
	fam.zheng, zhengqi.arch, Muchun Song

The preparation of supporting freeing vmemmap associated with each
HugeTLB page is ready, so we can support this feature for arm64.

Signed-off-by: Muchun Song <songmuchun@bytedance.com>
---
 arch/arm64/mm/mmu.c | 5 +++++
 fs/Kconfig          | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index 5d37e461c41f..967b01ce468d 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -23,6 +23,7 @@
 #include <linux/mm.h>
 #include <linux/vmalloc.h>
 #include <linux/set_memory.h>
+#include <linux/hugetlb.h>
 
 #include <asm/barrier.h>
 #include <asm/cputype.h>
@@ -1134,6 +1135,10 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
 	pmd_t *pmdp;
 
 	WARN_ON((start < VMEMMAP_START) || (end > VMEMMAP_END));
+
+	if (is_hugetlb_free_vmemmap_enabled() && !altmap)
+		return vmemmap_populate_basepages(start, end, node, altmap);
+
 	do {
 		next = pmd_addr_end(addr, end);
 
diff --git a/fs/Kconfig b/fs/Kconfig
index 6ce6fdac00a3..02c2d3bf1cb8 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -242,7 +242,7 @@ config HUGETLB_PAGE
 
 config HUGETLB_PAGE_FREE_VMEMMAP
 	def_bool HUGETLB_PAGE
-	depends on X86_64
+	depends on X86_64 || ARM64
 	depends on SPARSEMEM_VMEMMAP
 
 config MEMFD_CREATE
-- 
2.11.0


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

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

end of thread, other threads:[~2021-05-21  5:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18  9:18 [PATCH] arm64: mm: hugetlb: add support for free vmemmap pages of HugeTLB Muchun Song
2021-05-19 11:45 ` Anshuman Khandual
2021-05-19 12:03   ` David Hildenbrand
2021-05-20 11:54     ` Anshuman Khandual
2021-05-20 11:59       ` David Hildenbrand
2021-05-21  5:02         ` Anshuman Khandual
2021-05-19 12:49   ` [External] " Muchun Song
2021-05-20 12:00     ` Anshuman Khandual
2021-05-19 12:36 ` Anshuman Khandual
2021-05-19 14:43   ` [External] " Muchun Song
2021-05-19 15:22     ` Muchun Song
2021-05-19 16:21       ` Muchun Song
2021-05-19 22:44         ` Mike Kravetz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).