linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* hugetlb-check-pd_present-in-huge_pte_offset.patch added to -mm tree
@ 2005-08-29 22:48 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2005-08-29 22:48 UTC (permalink / raw)
  To: agl, linux-mm, mm-commits

The patch titled

     hugetlb: check p?d_present in huge_pte_offset()

has been added to the -mm tree.  Its filename is

     hugetlb-check-pd_present-in-huge_pte_offset.patch

Patches currently in -mm which might be from agl@us.ibm.com are

hugetlb-add-pte_huge-macro.patch
hugetlb-move-stale-pte-check-into-huge_pte_alloc.patch
hugetlb-check-pd_present-in-huge_pte_offset.patch



From: Adam Litke <agl@us.ibm.com>

For demand faulting, we cannot assume that the page tables will be
populated.  Do what the rest of the architectures do and test p?d_present()
while walking down the page table.

Signed-off-by: Adam Litke <agl@us.ibm.com>
Cc: <linux-mm@kvack.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 arch/i386/mm/hugetlbpage.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff -puN arch/i386/mm/hugetlbpage.c~hugetlb-check-pd_present-in-huge_pte_offset arch/i386/mm/hugetlbpage.c
--- 25/arch/i386/mm/hugetlbpage.c~hugetlb-check-pd_present-in-huge_pte_offset	Mon Aug 29 15:48:06 2005
+++ 25-akpm/arch/i386/mm/hugetlbpage.c	Mon Aug 29 15:48:06 2005
@@ -46,8 +46,11 @@ pte_t *huge_pte_offset(struct mm_struct 
 	pmd_t *pmd = NULL;
 
 	pgd = pgd_offset(mm, addr);
-	pud = pud_offset(pgd, addr);
-	pmd = pmd_offset(pud, addr);
+	if (pgd_present(*pgd)) {
+		pud = pud_offset(pgd, addr);
+		if (pud_present(*pud))
+			pmd = pmd_offset(pud, addr);
+	}
 	return (pte_t *) pmd;
 }
 
_
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-08-29 22:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-29 22:48 hugetlb-check-pd_present-in-huge_pte_offset.patch added to -mm tree akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox