Thread (3 messages) 3 messages, 2 authors, 2014-03-20

[RESEND PATCH] mm: hugetlb: Introduce huge_pte_{page,present,young}

From: akpm@linux-foundation.org (Andrew Morton)
Date: 2014-03-17 22:07:33
Also in: linux-mm

On Mon, 17 Mar 2014 18:51:58 +0000 Steve Capper [off-list ref] wrote:
Introduce huge pte versions of pte_page, pte_present and pte_young.
This allows ARM (without LPAE) to use alternative pte processing logic
for huge ptes.

Where these functions are not defined by architectural code they
fallback to the standard functions.

Signed-off-by: Steve Capper <redacted>
---
Hi,
I'm resending this patch to provoke some discussion.

We already have some huge_pte_ style functions, and this patch adds a
few more (that simplify to the pte_ equivalents where unspecified).

Having separate hugetlb versions of pte_page, present and mkyoung
allows for a greatly simplified huge page implementation for ARM with
the classical MMU (which has a different bit layout for huge ptes).
Looks OK to me.  One thing...
quoted hunk ↗ jump to hunk
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -353,6 +353,18 @@ static inline pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma,
 }
 #endif
 
+#ifndef huge_pte_page
+#define huge_pte_page(pte)	pte_page(pte)
+#endif
This #ifndef x #define x thing works well, but it is 100% unclear which
arch header file is supposed to define x if it wishes to override the
definition.  We've had problems with that in the past where different
architectures put it in different files and various breakages ensued.

So can we decide which arch header file is responsible for defining
these, then document that right here in a comment and add an explicit
#include <asm/that-file.h>?

+#ifndef huge_pte_present
+#define huge_pte_present(pte)	pte_present(pte)
+#endif
+
+#ifndef huge_pte_mkyoung
+#define huge_pte_mkyoung(pte)	pte_mkyoung(pte)
+#endif
+
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help