linux-mips
[Top] [All Lists]

Re: Anyone noticed that there are a lot of cache flushes after kunmap/ku

To: David VomLehn <dvomlehn@cisco.com>
Subject: Re: Anyone noticed that there are a lot of cache flushes after kunmap/kunmap_atomic is called?
From: Ralf Baechle <ralf@linux-mips.org>
Date: Fri, 8 Aug 2008 09:24:04 +0100
Cc: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
In-reply-to: <489A5975.1000401@cisco.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <489A5975.1000401@cisco.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.18 (2008-05-17)
On Wed, Aug 06, 2008 at 07:09:57PM -0700, David VomLehn wrote:

> On the MIPS processor, cache flushing is done based on virtual addresses. 
> However, in the Linux kernel, there are a lot of places where memory is 
> mapped with kmap or kmap_atomic, then unmapped with the corresponding 
> kunmap or kunmap_atomic and only *then* is the cache flushed. In other 
> words, we only flush the cache after we have dropped the mapping of 
> memory into a virtual address. I think this is generally wrong.
>
> This may really only affect those of us who have enabled high memory, but 
> it's pretty prevalent in kernel code. We noted this before, but have 
> apparently just been bitten by it. Is it just me or is there a fairly 
> widespread problem for processors that flush the cache using virtual 
> addresses?

Not all MIPS processors have virtually indexed caches; some have physically
indexed caches or caches which behave effectivly like physically indexed
and MIPS highmem only tries to support the latter kinds of caches.  Which
means most of the cache flushes turn into nops anyway.

  Ralf

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