Subject: Re: Performance dive
To: None <port-pmax@netbsd.org, jeffs@netbsd.org, chuq@chuq.com>
From: Toru Nishimura <nisimura@itc.aist-nara.ac.jp>
List: port-pmax
Date: 03/19/2001 10:24:49
Hi,

> next is mips1_FlushDCache(), mostly called from pmap_remove_pv() ->
> pmap_remove() -> pmap_enter().    pmap_enter() is called about 2/3
> of the time from uvm_pagermapin() and the other 1/3 of the time
> from ubc_fault().  now this interesting thing here is that pmap_enter()
> called from uvm_pagermapin() or ubc_fault() should only ever be overwriting
> an invalid mapping, never changing one valid mapping to a different one,
> so it's shouldn't be necessary to flush anything.

Most of recent mods in mips/mips/pmap.c looks pretty questionable.  I
don't agree them.

#ifdef MIPS1
        if (CPUISMIPS3 == 0 && last != 0) {
                MachFlushDCache(MIPS_PHYS_TO_KSEG0(pa), PAGE_SIZE);
        }
#endif

This is unnecessary to do.  It's a physically addressed, physically addressed
tagged, write thru cache.  That means near zero needs to flush Dcache any
time.

> if the previous mapping was invalid, then we should skip the pmap_remove()
> just like we do if the new mapping is the same as the old one.

I have been feeding water to my own breed of MIPS pmap.c, which is not
mature enough to replace current one.

I will take magifying glass on your analysis.

Tohru Nishimura