Skip to contentSkip to conversation

Avoid duplicate running of pud_offset and pmd_offset in one_md_table_init()

PATCH Applied Zhaolei 2 participants 2 messages Oct 31, 2008

Subsystems (2)
lore
Share & tools
lore

Zhaolei

author
#0 lore raw

PATCH 1/1 Avoid duplicate running of pud_offset and pmd_offset in one_md_table_init()

If !(pgd_val(*pgd) & _PAGE_PRESENT) in PAE mode, we need not get value of pmd_table again.

---
 arch/x86/mm/init_32.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/x86/mm/init_32.c +2 -0
index 8396868..7f8a2da 100644
@@ -102,6 +102,8 @@ static pmd_t * __init one_md_table_init(pgd_t *pgd)
 		set_pgd(pgd, __pgd(__pa(pmd_table) | _PAGE_PRESENT));
 		pud = pud_offset(pgd, 0);
 		BUG_ON(pmd_table != pmd_offset(pud, 0));
+
+		return pmd_table;
 	}
 #endif
 	pud = pud_offset(pgd, 0);
Signature · 1 line
1.5.5.3
Applied
#1 lore raw
Quoted 7 lines · Zhaolei

If !(pgd_val(*pgd) & _PAGE_PRESENT) in PAE mode, we need not get value of pmd_table again.

---
 arch/x86/mm/init_32.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

applied to tip/x86/cleanups, thanks!

Ingo