Re: mmap/munmap semantics

From: Eric W. Biederman (ebiederm+eric@ccr.net)
Date: Thu Feb 24 2000 - 08:41:45 EST


"Stephen C. Tweedie" <sct@redhat.com> writes:

> Hi,
>
> On Thu, 24 Feb 2000 03:35:02 +0100, Jamie Lokier
> <lk@tantalophile.demon.co.uk> said:
>
> > I don't think MADV_DONTNEED actually drops privately modified data does
> > it?
>
> Yes, it does. From the DU man pages:
>
> MADV_DONTNEED
> Do not need these pages
>
> The system will free any whole pages in the specified
> region. All modifications will be lost and any swapped
> out pages will be discarded. Subsequent access to the
> region will result in a zero-fill-on-demand fault as
> though it is being accessed for the first time.
> Reserved swap space is not affected by this call.

Which is fine but if it works this way on shared memory it is broken,
at least unless all mappings set (MADV_DONTNEED) and you can prove there
was no file-io. Otherwise you could loose legitimate file writes.

Also from an irix man page:

     MADV_DONTNEED informs the system that the address range from addr to
                      addr + len will likely not be referenced in the near
                      future. The memory to which the indicated addresses are
                      mapped will be the first to be reclaimed when memory is
                      needed by the system.

Eric

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



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