Re: mmap/munmap semantics

From: Richard Guenther (
Date: Thu Feb 24 2000 - 05:06:25 EST

On Wed, 23 Feb 2000, Benjamin C.R. LaHaise wrote:

> On Wed, 23 Feb 2000, Richard Guenther wrote:
> > So how can I throw away a dirty (shared) mapping of a file without
> > generating disk io? Remember, I do not care about the contents of the file
> > at the mmap place.
> > A possible solution would be to be able to convert a shared mapping to
> > a private one? If I'm the only user of the shared mapping (so its a
> > virtually private one) this should be easy - just "disconnect" it. In the
> > other case I do not really know how to handle this.
> The most portable and easiest way to achieve this behaviour right now is
> to use individual files or shm segments for the shared mappings. Using
> SysV shared memory will get you the most performance since it won't get
> written back to disk early (like mmaped files). If that doesn't give you
> enough space, I strongly recommend using 1 file per shared "segment",
> since the semantics you get by truncating and then extending the mapping
> are exactly what you want. As a bonus, this technique works on
> filesystems that don't support files with holes =)

Yes, but unfortunately the individual file approach does not work in case
we (ideally) want to operate on a whole disk...


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

This archive was generated by hypermail 2b29 : Tue Feb 29 2000 - 21:00:09 EST