From: David W. <dw...@in...> - 2001-12-05 08:33:22
|
> +#if !defined(CONFIG_SUPERH) /* this is not needed for VIPT cache */ > flush_cache_page(vma, address); > +#endif Could there possibly be a more graphic demonstration of just how horribly stupid and broken the existing Linux cache management API currently is? The fact that some architectures actually achieve what you're trying to do here by making flush_cache_page() a NOP doesn't help make things better, either :) 2.5 has opened. I think it's time to provide an API to the cache code that actually makes sense, and the functions bear some relation to their behaviour and the reasons for calling them. Hint: Generic code, which knows nothing about how the CPU's cache works, almost never actually _needs_ to flush a page. It normally only wants to make sure there are no aliases with other virtual addresses in the dcache, or that code newly written through the dcache is present in the icache. Hence, the word 'flush' should no appear in the names of functions called from generic code. So contemplate how sane it would be to have functions called unalias_dcache_page_ram, unalias_dcache_page_icache, or something vaguely representing the actual behaviour - then it's perfectly OK to have some of them do nothing, and you can far more easily make sure the right ones are called at the right times, and do the right things. We really shouldn't need arch-specific ifdefs like that in common code. -- dwmw2 |