lkml.org 
[lkml]   [2020]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 22/24] mm/hugetlb: Implement vmemmap_pmd_mkhuge macro
Date
In vmemmap_populate_hugepages(), we use PAGE_KERNEL_LARGE for
huge page mapping. So we can inplement vmemmap_pmd_mkhuge macro
to do that.

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

diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h
index 7c3eb60c2198..9f9e19dd0578 100644
--- a/arch/x86/include/asm/hugetlb.h
+++ b/arch/x86/include/asm/hugetlb.h
@@ -15,6 +15,14 @@ static inline bool vmemmap_pmd_huge(pmd_t *pmd)
{
return pmd_large(*pmd);
}
+
+#define vmemmap_pmd_mkhuge vmemmap_pmd_mkhuge
+static inline pmd_t vmemmap_pmd_mkhuge(struct page *page)
+{
+ pte_t entry = pfn_pte(page_to_pfn(page), PAGE_KERNEL_LARGE);
+
+ return __pmd(pte_val(entry));
+}
#endif

#define hugepages_supported() boot_cpu_has(X86_FEATURE_PSE)
--
2.20.1
\
 
 \ /
  Last update: 2020-09-16 02:42    [W:0.160 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site