Re: mmap/munmap semantics

From: lars brinkhoff (lars.brinkhoff@intermec.com)
Date: Thu Feb 24 2000 - 08:06:08 EST


"Stephen C. Tweedie" wrote:
> 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.

>From a FreeBSD man page at
http://dorifer.heim3.tu-clausthal.de/cgi-bin/man/madvise.2.html

     MADV_DONTNEED Allows the VM system to decrease the in-memory priority
                      of pages in the specified range. Additionally future
                      references to this address range will incur a page
                      fault.

     MADV_FREE Gives the VM system the freedom to free pages, and tells
                      the system that information in the specified page range
                      is no longer important. This is an efficient way of al-
                      lowing malloc(3) to free pages anywhere in the address
                      space, while keeping the address space valid. The next
                      time that the page is referenced, the page might be de-
                      mand zeroed, or might contain the data that was there
                      before the MADV_FREE call. References made to that ad-
                      dress space range will not make the VM system page the
                      information back in from backing store until the page is
                      modified again.

-
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:09 EST