Skip to content

Commit

Permalink
ARM: improve compiler's ability to optimize page tables
Browse files Browse the repository at this point in the history
Allow the compiler to better optimize the page table walking code
by avoiding over-complex pmd_addr_end() calculations.  These
calculations prevent the compiler spotting that we'll never iterate
over the PMD table, causing it to create double nested loops where
a single loop will do.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Nov 21, 2010
1 parent 589136b commit c0ba10b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/arm/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ static inline pte_t *pmd_page_vaddr(pmd_t pmd)

#define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd)))

/* we don't need complex calculations here as the pmd is folded into the pgd */
#define pmd_addr_end(addr,end) (end)

/*
* Conversion functions: convert a page and protection to a page entry,
* and a page entry and page directory to the page they refer to.
Expand Down

0 comments on commit c0ba10b

Please sign in to comment.