Skip to content

Commit

Permalink
x86: avoid duplicate running of pud_offset and pmd_offset in one_md_t…
Browse files Browse the repository at this point in the history
…able_init()

Impact: simplify implementation, cleanup

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

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Zhaolei authored and Ingo Molnar committed Oct 31, 2008
1 parent 7a52768 commit a376f30
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/x86/mm/init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a376f30

Please sign in to comment.