[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200915125947.26204-23-songmuchun@bytedance.com>
Date: Tue, 15 Sep 2020 20:59:45 +0800
From: Muchun Song <songmuchun@...edance.com>
To: corbet@....net, mike.kravetz@...cle.com, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, x86@...nel.org, hpa@...or.com,
dave.hansen@...ux.intel.com, luto@...nel.org, peterz@...radead.org,
viro@...iv.linux.org.uk, akpm@...ux-foundation.org,
paulmck@...nel.org, mchehab+huawei@...nel.org,
pawan.kumar.gupta@...ux.intel.com, rdunlap@...radead.org,
oneukum@...e.com, anshuman.khandual@....com, jroedel@...e.de,
almasrymina@...gle.com, rientjes@...gle.com
Cc: linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, linux-fsdevel@...r.kernel.org,
Muchun Song <songmuchun@...edance.com>
Subject: [RFC PATCH 22/24] mm/hugetlb: Implement vmemmap_pmd_mkhuge macro
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@...edance.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
Powered by blists - more mailing lists