diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2013-04-12 06:02:06 -0400 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2013-05-07 09:38:14 -0400 |
commit | 764531cc5a9261de9f74fd85c30dfb7837af2797 (patch) | |
tree | d0dea2be2f405413d808de1399634b7366a179a2 /arch/arc/mm | |
parent | 7f250a0fa1cc7f8d97560f4ea36eae38c17eb648 (diff) |
ARC: [mm] micro-optimize page size icache invalidate
start address is already page aligned and size is const PAGE_SIZE,
thus fixups for alignment not needed in generated code.
bloat-o-meter vmlinux-mm5 vmlinux
add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-32 (-32)
function old new delta
__inv_icache_page 82 50 -32
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/mm')
-rw-r--r-- | arch/arc/mm/cache_arc700.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/arch/arc/mm/cache_arc700.c b/arch/arc/mm/cache_arc700.c index da9de401681d..3a9ef63b1a97 100644 --- a/arch/arc/mm/cache_arc700.c +++ b/arch/arc/mm/cache_arc700.c | |||
@@ -406,9 +406,18 @@ static void __ic_line_inv_vaddr(unsigned long phy_start, unsigned long vaddr, | |||
406 | int num_lines, slack; | 406 | int num_lines, slack; |
407 | unsigned int addr; | 407 | unsigned int addr; |
408 | 408 | ||
409 | slack = phy_start & ~ICACHE_LINE_MASK; | 409 | /* |
410 | sz += slack; | 410 | * Ensure we properly floor/ceil the non-line aligned/sized requests: |
411 | phy_start -= slack; | 411 | * However page sized flushes can be compile time optimised. |
412 | * -@phy_start will be cache-line aligned already (being page aligned) | ||
413 | * -@sz will be integral multiple of line size (being page sized). | ||
414 | */ | ||
415 | if (!(__builtin_constant_p(sz) && sz == PAGE_SIZE)) { | ||
416 | slack = phy_start & ~ICACHE_LINE_MASK; | ||
417 | sz += slack; | ||
418 | phy_start -= slack; | ||
419 | } | ||
420 | |||
412 | num_lines = DIV_ROUND_UP(sz, ARC_ICACHE_LINE_LEN); | 421 | num_lines = DIV_ROUND_UP(sz, ARC_ICACHE_LINE_LEN); |
413 | 422 | ||
414 | #if (CONFIG_ARC_MMU_VER > 2) | 423 | #if (CONFIG_ARC_MMU_VER > 2) |