lkml.org 
[lkml]   [2000]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: mmap/munmap semantics
"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/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:1.041 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site