Re: mmap() page swapping location?

From: Richard Guenther (
Date: Wed Aug 02 2000 - 06:57:53 EST

On 2 Aug 2000, Juan J. Quintela wrote:

> >>>>> "chris" == Chris Quinn <> writes:
> Hi Chris
> chris> I don't think MAP_PRIVATE quite fits the bill because pages
> chris> become divorced from the file; msync() and munmap() seem no
> chris> longer to reflect changes back to disk. I want to keep that
> chris> association as it is efficient.
> not at all, the only differece between MAP_PRIVATE and MAP_SHARED is
> that you need to do an msync with MAP_PRIVATE to write to the disk,
> with MAP_SHARED the write to the disk will be an any time.

You are wrong wrt MAP_PRIVATE semantics. You really need to mmap
MAP_SHARED to get the file updated: [quoting from SUS2]

When the msync() function is called on MAP_PRIVATE mappings, any modified
data will not be written to the underlying object and will not cause such
data to be made visible to other processes. It is unspecified whether data
in MAP_PRIVATE mappings has any permanent storage locations.


Richard Guenther <>
The GLAME Project:

- 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 : Mon Aug 07 2000 - 21:00:08 EST