Re: 2.6.13-rc3: cache flush missing from somewhere

Catalin Marinas
2005-08-01T18:40:03Z

Russell King <rmk+lkml@arm.linux.org.uk> wrote:
> On Mon, Aug 01, 2005 at 05:54:33PM +0100, Catalin Marinas wrote:
>> I haven't checked the original patch but it might work (by luck)
>> without the I-cache invalidation (and without stressing it too
>> much). This is because you might do a full mm flush when a process
>> exits and the I-cache would be clean for newly allocated pages (only
>> the D-cache needs flushing). If you don't overload memory, you don't
>> get pages swapped-out/removed and the code in a page for a given
>> process might remain unchanged until the process exits.
>
> Given that it's sometimes going wrong as early as the first process, I
> doubt this is what's happening. The i-cache will be clean at this point
> for the userspace programs.

The I-cache might not be completely clean when executing the first
process since the kernel already ran code from the .init.text section
which is freed.

Anyway, the problem you are seeing, apart from the I-cache flushing,
looks to me like being caused by not flushing the D-cache on the CPU
that actually wrote the page (not the one handling the page
fault). That's why flushing immediately (not lazily) seems to work.

--
Catalin