Skip to contentSkip to conversation

ARC: add hugetlb definitions

PATCH In review Pavel Kozlov 2 participants 2 messages Dec 13, 2023 – Dec 14, 2023 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARC: add hugetlb definitions

From: Pavel Kozlov <[email protected]>

Add hugetlb definitions if THP enabled. ARC doesn't support HugeTLB FS but it supports THP. Some kernel code such as pagemap uses hugetlb definitions with THP.

This patch fixes ARC build issue (HPAGE_SIZE undeclared error) with TRANSPARENT_HUGEPAGE enabled.

---
 arch/arc/include/asm/hugepage.h | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arc/include/asm/hugepage.h +7 -0
index ef8d4166370c..8a2441670a8f 100644
@@ -10,6 +10,13 @@
 #include <linux/types.h>
 #include <asm-generic/pgtable-nopmd.h>
 
+/*
+ * Hugetlb definitions.
+ */
+#define HPAGE_SHIFT		PMD_SHIFT
+#define HPAGE_SIZE		(_AC(1, UL) << HPAGE_SHIFT)
+#define HPAGE_MASK		(~(HPAGE_SIZE - 1))
+
 static inline pte_t pmd_pte(pmd_t pmd)
 {
 	return __pte(pmd_val(pmd));
Signature · 7 lines
2.25.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#1 lore raw
Quoted 10 lines · Pavel Kozlov

From: Pavel Kozlov <[email protected]>

Add hugetlb definitions if THP enabled. ARC doesn't support HugeTLB FS but it supports THP. Some kernel code such as pagemap uses hugetlb definitions with THP.

This patch fixes ARC build issue (HPAGE_SIZE undeclared error) with TRANSPARENT_HUGEPAGE enabled.

Added to for-curr.

I'll pile this will rest of patches for some linux-next soaking.

Thx,
-Vineet