[Top] [All Lists]

Re: __flush_cache_all() miscellany

To: Justin Carlson <>
Subject: Re: __flush_cache_all() miscellany
From: Ralf Baechle <>
Date: Wed, 29 May 2002 14:07:59 -0700
In-reply-to: <>; from on Wed, May 29, 2002 at 09:50:52AM -0700
References: <>
User-agent: Mutt/
On Wed, May 29, 2002 at 09:50:52AM -0700, Justin Carlson wrote:

> Looking at the cache routines, I've noticed that there's been a
> relatively recent introduction of a __flush_cache_all() routine. 
> Looking at's cvs logs, I see this comment:
> >Introduce __flush_cache_all() which flushes the cache no matter if
> >this operation is necessary from the mm point of view or not.
> Some questions:
> Which caches does this apply to?  It looks like the current
> implementations assume L1 only.

The operation got introduced for the R10000 where we only need to flush
the caches during initialization or the (unlikely on Origin) case of

> Would anyone have a problem with renaming this function?  To me, at
> least, it's rather confusing to have all of:

No.  You may have noticed that I already introduced a bunch of local_*()
functions for the TLB stuff for the same reason - the old functions had
poor names.  The common Linux conventions to use extra underscores for a
more basic version of a function (like get_user vs __get_user etc.) is
frequently not expressive enough.

> flush_cache_all()
> _flush_cache_all()
> __flush_cache_all()
> ___flush_cache_all()

Odd number of underscores means it's a pointer ;)

> defined, especially when the latter two mean something significantly
> different from the former two.  I'd prefer calling the new one
> {_}force_flush_l1_caches() or somesuch.


> In a related note, one of the few places this routine is called is the
> kgdb stub routines (in arch/mips/kernel/gdb-stub.c):
> void set_async_breakpoint(unsigned int epc)
> {
>       int cpu = smp_processor_id();
>       async_bp[cpu].addr = epc;
>       async_bp[cpu].val  = *(unsigned *)epc;
>       *(unsigned *)epc = BP;
>       __flush_cache_all();
> }
> Shouldn't that be a flush_icache_range() call anyways?



<Prev in Thread] Current Thread [Next in Thread>