diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-09-09 14:04:06 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-09-09 14:04:06 +0900 |
commit | 654d364e26c797e8a5f9e2a1393607e6ca0106eb (patch) | |
tree | 69af9234533e6972404434d694272200c13477b8 /arch/sh/mm/cache.c | |
parent | 682f88ab74e55dae55ea3bf30b46f56f71b793bd (diff) | |
download | op-kernel-dev-654d364e26c797e8a5f9e2a1393607e6ca0106eb.zip op-kernel-dev-654d364e26c797e8a5f9e2a1393607e6ca0106eb.tar.gz |
sh: sh4_flush_cache_mm() optimizations.
The i-cache flush in the case of VM_EXEC was added way back when as a
sanity measure, and in practice we only care about evicting aliases from
the d-cache. As a result, it's possible to drop the i-cache flush
completely here.
After careful profiling it's also come up that all of the work associated
with hunting down aliases and doing ranged flushing ends up generating
more overhead than simply blasting away the entire dcache, particularly
if there are many mm's that need to be iterated over. As a result of
that, just move back to flush_dcache_all() in these cases, which restores
the old behaviour, and vastly simplifies the path.
Additionally, on platforms without aliases at all, this can simply be
nopped out. Presently we have the alias check in the SH-4 specific
version, but this is true for all of the platforms, so move the check up
to a generic location. This cuts down quite a bit on superfluous cacheop
IPIs.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm/cache.c')
-rw-r--r-- | arch/sh/mm/cache.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/sh/mm/cache.c b/arch/sh/mm/cache.c index 35c37b7..4aa9260 100644 --- a/arch/sh/mm/cache.c +++ b/arch/sh/mm/cache.c @@ -164,11 +164,17 @@ void flush_cache_all(void) void flush_cache_mm(struct mm_struct *mm) { + if (boot_cpu_data.dcache.n_aliases == 0) + return; + cacheop_on_each_cpu(local_flush_cache_mm, mm, 1); } void flush_cache_dup_mm(struct mm_struct *mm) { + if (boot_cpu_data.dcache.n_aliases == 0) + return; + cacheop_on_each_cpu(local_flush_cache_dup_mm, mm, 1); } |