[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <160698645116.3364.7718413514903352862.tip-bot2@tip-bot2>
Date: Thu, 03 Dec 2020 09:07:31 -0000
From: "tip-bot2 for Peter Zijlstra" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: "Peter Zijlstra (Intel)" <peterz@...radead.org>,
"Matthew Wilcox (Oracle)" <willy@...radead.org>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: perf/core] mm: Introduce pXX_leaf_size()
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 93aec63b945579b679234ff5e5d7837baf2c7018
Gitweb: https://git.kernel.org/tip/93aec63b945579b679234ff5e5d7837baf2c7018
Author: Peter Zijlstra <peterz@...radead.org>
AuthorDate: Fri, 13 Nov 2020 11:45:36 +01:00
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Thu, 03 Dec 2020 10:00:30 +01:00
mm: Introduce pXX_leaf_size()
A number of architectures have non-pagetable aligned huge/large pages.
For such architectures a leaf can actually be part of a larger entry.
Provide generic helpers to determine the size of a page-table leaf.
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: Matthew Wilcox (Oracle) <willy@...radead.org>
Link: https://lkml.kernel.org/r/20201126121121.102580109@infradead.org
---
include/linux/pgtable.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
index c8602af..8fcdfa5 100644
--- a/include/linux/pgtable.h
+++ b/include/linux/pgtable.h
@@ -1549,4 +1549,20 @@ typedef unsigned int pgtbl_mod_mask;
#define pmd_leaf(x) 0
#endif
+#ifndef pgd_leaf_size
+#define pgd_leaf_size(x) (1ULL << PGDIR_SHIFT)
+#endif
+#ifndef p4d_leaf_size
+#define p4d_leaf_size(x) P4D_SIZE
+#endif
+#ifndef pud_leaf_size
+#define pud_leaf_size(x) PUD_SIZE
+#endif
+#ifndef pmd_leaf_size
+#define pmd_leaf_size(x) PMD_SIZE
+#endif
+#ifndef pte_leaf_size
+#define pte_leaf_size(x) PAGE_SIZE
+#endif
+
#endif /* _LINUX_PGTABLE_H */
Powered by blists - more mailing lists