Commit b4c89276 authored by Matt Fleming's avatar Matt Fleming

sh: Optimise flush_dcache_page() on SH4

If the page is not mapped into any process's address space then aliases
cannot exist in the cache. So reduce the amount of flushing we perform.
Signed-off-by: default avatarMatt Fleming <matt@console-pimps.org>
parent 3f5ab768
...@@ -109,6 +109,7 @@ static inline void flush_cache_one(unsigned long start, unsigned long phys) ...@@ -109,6 +109,7 @@ static inline void flush_cache_one(unsigned long start, unsigned long phys)
static void sh4_flush_dcache_page(void *arg) static void sh4_flush_dcache_page(void *arg)
{ {
struct page *page = arg; struct page *page = arg;
unsigned long addr = (unsigned long)page_address(page);
#ifndef CONFIG_SMP #ifndef CONFIG_SMP
struct address_space *mapping = page_mapping(page); struct address_space *mapping = page_mapping(page);
...@@ -116,16 +117,8 @@ static void sh4_flush_dcache_page(void *arg) ...@@ -116,16 +117,8 @@ static void sh4_flush_dcache_page(void *arg)
set_bit(PG_dcache_dirty, &page->flags); set_bit(PG_dcache_dirty, &page->flags);
else else
#endif #endif
{ flush_cache_one(CACHE_OC_ADDRESS_ARRAY |
unsigned long phys = page_to_phys(page); (addr & shm_align_mask), page_to_phys(page));
unsigned long addr = CACHE_OC_ADDRESS_ARRAY;
int i, n;
/* Loop all the D-cache */
n = boot_cpu_data.dcache.n_aliases;
for (i = 0; i < n; i++, addr += PAGE_SIZE)
flush_cache_one(addr, phys);
}
wmb(); wmb();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment