Subject: Re: mmap
To: Andreas Wrede <andreas@planix.com>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: current-users
Date: 11/09/1998 16:13:43
.. just FYI, I tried this on suons 4.1.3_U1 with MAP_FILE defined to 0
(MAP_FILE is the default and need not be specified, but my sunos
headers dont have it.)  No errors.

The first failure ("shared map does not match within page") is:
    open file, 
    mmap file as shared,
    write(2) to mapped backing file,
    do msync(MS_INVALIDATE),
    read addresses in mapped file corresponding to write(2)

The error is that after the msync(), the contents of the MAP_SHARED
region are not the same as the mapped (backing) file. the msync()
should guarantee that they are. 

I think that's a bug in UVM.  Chuck?


The second error "private map does not match within page") is: is
similar, except since the map is copy-on-write, the source code
munmap()s and then re-mmap()s the backing file.  Oops, that fails too.


The third error ("shared map does not match within page") is,
basically, the same as the second; except the write(2) is done using a
distinct file descriptor (from a second open() call on the backing
file) from the fd used for the mmap(). (since the previous test
failed, and they'll be using the smae buffer cache pages, that this
fails too is no surprise.)

The last two look like "standard" NetBSD lossage due to the nonunified
VM/buffer-cache, but thats just an informed guess.  if i'm right, they
probably wont be fixed until the VM/buffer cache is.