[parisc-linux] Re: RFC: mmap patch

Matthew Wilcox willy@debian.org
Sat, 8 Mar 2003 23:11:25 +0000


On Fri, Mar 07, 2003 at 10:29:45PM -0800, David S. Miller wrote:
> If you flush caches exactly what sparc64 does in 2.5.x, and you do
> have a virtually indexed, physically tagged cache, you should have no
> correctness.  I've stressed that port to no end (in particular the LTP
> suite has a great mmap/read/write coherency tester), and if there are
> holes I'd like to know about them :-)

One other difference you forgot is that Sparc64 has writethrough caches
and PA has writeback caches.  This can make a difference.

> The most crucial area to get efficient flushing is the
> {copy,clear}_user_page implementation.  If you use temporary kernel
> mappings mapped at virtual addresses matching the virtual color that
> the user's mappings will have, this avoids virtually ALL of the
> flushing for anonymous pages.  I haven't noticed too many ports pick
> up this trick even though I mention it in cachetlb.txt.

I've certainly been thinking about doing it, but you're right we don't
do it yet.

> On sparc64 I even save the original TLB entries before the flush
> and restore them afterwards, so there is no TLB traffic as a result
> of doing these temp mappings.

Nice trick.

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk