[Resend] [Hugetlb x86] 3/3 Check p?d_present in huge_pte_offset()
From: Adam Litke (agl_at_us.ibm.com)
Date: 08/26/05
- Previous message: Adam Litke: "[Resend] [Hugetlb x86] 1/3 Add pte_huge() macro"
- In reply to: Adam Litke: "[Hugetlb x86] Small hugetlb arch updates for i386 and x86_64"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: akpm@osdl.org Date: Fri, 26 Aug 2005 09:09:26 -0500
Initial Post (Wed, 17 Aug 2005)
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.
Diffed against 2.6.13-rc6
Signed-off-by: Adam Litke <agl@us.ibm.com>
---
hugetlbpage.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff -upN reference/arch/i386/mm/hugetlbpage.c current/arch/i386/mm/hugetlbpage.c
--- reference/arch/i386/mm/hugetlbpage.c
+++ current/arch/i386/mm/hugetlbpage.c
@@ -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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Adam Litke: "[Resend] [Hugetlb x86] 1/3 Add pte_huge() macro"
- In reply to: Adam Litke: "[Hugetlb x86] Small hugetlb arch updates for i386 and x86_64"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|