linux-mips
[Top] [All Lists]

Re: [PATCH]: c-r4k.c 4/7 flush_cache_mm cleanup

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH]: c-r4k.c 4/7 flush_cache_mm cleanup
From: Juan Quintela <quintela@mandrakesoft.com>
Date: Sat, 29 Mar 2003 15:41:01 +0100
Cc: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>, mipslist <linux-mips@linux-mips.org>
In-reply-to: <20030328195953.A17890@linux-mips.org> (Ralf Baechle's message of "Fri, 28 Mar 2003 19:59:53 +0100")
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <m2smt89ut8.fsf@neno.mitica> <Pine.GSO.3.96.1030328175039.26178B-100000@delta.ds2.pg.gda.pl> <20030328195953.A17890@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2.93
>>>>> "ralf" == Ralf Baechle <ralf@linux-mips.org> writes:

ralf> On Fri, Mar 28, 2003 at 06:51:57PM +0100, Maciej W. Rozycki wrote:
>> >    flush_cache_mm can use __flush_cache_all.
>> 
>> Wrong, it should use r4k_flush_pcache_all() unconditionally, but I'm told
>> such a setup triggers a bug somewhere, that needs to be tracked down
>> before committing that change to the CVS.

ralf> Now that the problem is mentioned on the list lemme elaborate a bit.  The
ralf> problem mentioned only affects R4000SC and R4400SC processors.
ralf> Flush_cache_mm is only used when a mm is either copied on fork or when
ralf> it's finally destroyed.  Because the S-cache is is physically indexed
ralf> and the P-cache is refilled from the S-cache if data should be still in
ralf> there we don't need to flush the S-cache ever for any of the mm's
ralf> cacheflushing functions.  So the observation that things are only
ralf> working properly if we do flush the S-cache also suggest we're either
ralf> having a bug elsewhere in the cache code or we're hitting a hardware
ralf> problem.

Just to add some more data points. flush_cache_mm() is only called
from two places:

- kernel/fork.c::dup_mmap()
- mm/mmap.c::exit_mmap()

I just changed flush_cache_mm() to be r4k_flush_pcache_all() and put
after the two calls a __flush_cache_all().  As expected everything
worked :)

Now if I removed teh __flush_cache_all() for any of the callers,
everything goes well.  But if I remove it for both of them things
crashed during boot.  I am looking at the code of both functions, and
can't see a good reason for them to fail :(

Does that ring any bells on you?

I am still investigating that one.

Later, Juan.


-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy

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