parisc: Improve cache flushing under qemu
Helge Deller
maintainerPATCH 1/1 parisc: Improve cache flushing under qemu
In QEMU we emulate a machine without any data or instruction caches. Avoid calling the assembly cache flush functions when we have no caches improves speed with qemu a lot.
Signed-off-by Helge Deller <[email protected]>
arch/parisc/kernel/cache.c +12 -3
@@ -55,11 +55,17 @@ static struct pdc_btlb_info btlb_info __read_mostly;void flush_data_cache (void ) { +if (unlikely (!cache_info.dc_size)) +return ; +on_each_cpu (flush_data_cache_local,NULL ,1 ); }void flush_instruction_cache (void ) { +if (unlikely (!cache_info.ic_size)) +return ; +on_each_cpu (flush_instruction_cache_local,NULL ,1 ); }#endif
@@ -67,8 +73,10 @@ flush_instruction_cache(void)void flush_cache_all_local (void ) { -flush_instruction_cache_local (NULL ); -flush_data_cache_local (NULL ); +if (likely (cache_info.ic_size)) +flush_instruction_cache_local (NULL ); +if (likely (cache_info.dc_size)) +flush_data_cache_local (NULL ); }EXPORT_SYMBOL (flush_cache_all_local);
@@ -506,7 +515,8 @@ static void cacheflush_h_tmp_function(void *dummy)void flush_cache_all (void ) { -on_each_cpu (cacheflush_h_tmp_function,NULL ,1 ); +if (likely (cache_info.dc_size || cache_info.ic_size)) +on_each_cpu (cacheflush_h_tmp_function,NULL ,1 ); }static inline unsigned long mm_total_size (struct mm_struct *mm)