Subject: Re: VCEI/VCED handling

From: [email-masked]
Date: Sat, 3 Oct 1998 18:00:09 +0200

On Tue, Sep 29, 1998 at 06:21:03PM -0700, William J. Earl wrote:

>        On the machines without VCE detection (R4000PC, R4600, R5000),
> the zero page is safe, because it is read-only.  Anonymous pages
> are not an issue, since they are not double-mapped.
> 
>        What is wrong with going from the mem_map_t.inode to the
> inode.i_mmap list of mappings, and thence to the PTEs?  IRIX, at least
> before IRIX 6.5, does the equivalent to solve this problem.

Nothing - anymore.  On older kernels your suggestion wouldn't have worked
for SYSV IPC, so I forgot about that possibility ...

>  > Mapping shared writeable pages uncached is not the solution.  The virtual
>  > coherency problem in Linux/MIPS may happen between multiple userspace
>  > mappings or userspace and kernelspace, that is KSEG0, mappings.  While
>  > we could disable caching for certain pages in the hope that we'll only
>  > end up with a few uncached pages making KSEG0 uncached is completly
>  > unacceptable performancewise.  However, if we don't, then we might end up
>  > with aliases between userspace pages and KSEG0 pages.
> 
>       You can use KSEG2 instead of KSEG0 for all pages which might be
> mapped into user space.  IRIX mostly does that, and keeps the KSEG2 mapping
> around only as long as necessary, and then only with the current virtual
> color (the color which currently has write ownership of the page) locked
> (which means that references via other colors block until the kernel
> gives up its mapping).  

It is my understanding that read/write syscalls used on mmaped file is the
only instance of that problem we need to deal with.  I think we can do so by
modifying update_vm_cache to fit the special needs of certain cache
architectures and introducing something similar to be used when reading.

The KSEG2 approach is definately much nicer for that than what we're using
right now for ptrace reading / writing to other processes' address space.

Btw, it looks like the MIPS NT HAL do the same thing.  At least the interfaces
provides by HAL.DLL strongly suggest so.

Oh, and somebody just promised to snail me a R4000SC module so I hope I can
tackle the SC problems rsn and make some more people lucky.

  Ralf