This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][RFC] Allow explicit shrinking of arena heaps using anenvironment variable


On Tue, Jul 31, 2012 at 01:24:14AM -0400, KOSAKI Motohiro wrote:
> > The choices are not mmap(MAP_FIXED) vs madvise(MADV_DONTNEED). They
> > are mmap(MAP_FIXED) vs madvise(MADV_DONTNEED) followed by
> > mprotect(PROT_NONE).
> 
> If PROT_NONE is must one, I don't see any reason to don't take
> mmap(MAP_FIXED).
> 
> but..
> Why do we need PROT_NONE? just for /proc/maps?

I think this is about the third or forth time I've explained it now.
PROT_NONE is needed to actually free the memory for other processes to
use. MADV_DONTNEED frees the physical memory (eliminates dirty pages
and thus prevents costly swapping of worthless data), but it does not
free the commit charge because the pages are still potentially
writable and thus not permanently backed by the zero page even though
they initially just reference it.

Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]