[RFC] powerpc: Merge 32/64 cacheflush code

David Gibson david at gibson.dropbear.id.au
Wed Dec 21 10:21:54 EST 2005


On Tue, Dec 20, 2005 at 11:27:49AM -0700, Mark A. Greer wrote:
> On Tue, Dec 20, 2005 at 12:06:17PM +1100, David Gibson wrote:
> <snip>
> > Previously, the ppc32 version of flush_dcache_range() did a writeback
> > and invalidate of the given cache lines (dcbf) whereas the ppc64
> > version did just a writeback (dcbst).  In general, there's no
> > consistent meaning of "flush" as one or the other, so this patch also
> > renames the dcache flushing functions less ambiguously.  The new names
> > are:
> > 
> > 	wback_dcache_range() - previously flush_dcache_range() on
> > ppc64 and clean_dcache_range() on ppc32
> > 
> > 	wback_inval_dcache_range() - previously
> > flush_inval_dcache_range() on ppc64 and flush_dcache_range on ppc32
> 
> I agree about the inconsistent meaning of 'flush' but I find 'wback'
> distracting b/c it also refers to a type of cache/cache mode.
> It makes me think that there's another set of routines for writethru or
> something like that.  I realize the caches are in writeback mode but the
> point is that it sends my brain down a different path than what is really
> meant.

I see what you mean, but I can't think of a better term.  We could use
"clean", but I don't like that very much either.

> Could we just define 'flush' to mean "push the cached data/instns back
> into memory but not invalidate" and still call them 'flush'?  Or use
> 'push' or something else that does also refer to a cache mode?

I don't think there's any way to make such a definition obvious enough
that someone won't make the same mistake at some later point.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson



More information about the Linuxppc64-dev mailing list