* [patch 040/220] hugetlb: check p?d_present in huge_pte_offset()
@ 2005-09-03 22:55 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2005-09-03 22:55 UTC (permalink / raw)
To: torvalds; +Cc: akpm, agl, linux-mm
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
--- devel/arch/i386/mm/hugetlbpage.c~hugetlb-check-pd_present-in-huge_pte_offset 2005-09-03 15:46:14.000000000 -0700
+++ devel-akpm/arch/i386/mm/hugetlbpage.c 2005-09-03 15:52:25.000000000 -0700
@@ -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-09-03 22:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-03 22:55 [patch 040/220] hugetlb: check p?d_present in huge_pte_offset() akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox