diff mbox series

[RFC,07/24] mm/hugetlb: Add freeing unused vmemmap pages support for x86

Message ID 20200915125947.26204-8-songmuchun@bytedance.com (mailing list archive)
State New, archived
Headers show
Series mm/hugetlb: Free some vmemmap pages of hugetlb page | expand

Commit Message

Muchun Song Sept. 15, 2020, 12:59 p.m. UTC
On x86_64 architecture, we use hupe page mapping vmemmap area. We
should define VMEMMAP_HPAGE_SHIFT to the correct value to support
freeing unused vmemmap pages.

Signed-off-by: Muchun Song <songmuchun@bytedance.com>
---
 arch/x86/include/asm/hugetlb.h | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h
index 1721b1aadeb1..f5e882f999cd 100644
--- a/arch/x86/include/asm/hugetlb.h
+++ b/arch/x86/include/asm/hugetlb.h
@@ -5,6 +5,11 @@ 
 #include <asm/page.h>
 #include <asm-generic/hugetlb.h>
 
+#ifdef CONFIG_HUGETLB_PAGE_FREE_VMEMMAP
+#define VMEMMAP_HPAGE_SHIFT			PMD_SHIFT
+#define arch_vmemmap_support_huge_mapping()	boot_cpu_has(X86_FEATURE_PSE)
+#endif
+
 #define hugepages_supported() boot_cpu_has(X86_FEATURE_PSE)
 
 #endif /* _ASM_X86_HUGETLB_H */