This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Question about madvise(DONTNEED) in glibc malloc
- From: KOSAKI Motohiro <kosaki dot motohiro at gmail dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: KOSAKI Motohiro <kosaki dot motohiro at gmail dot com>, libc-alpha <libc-alpha at sourceware dot org>
- Date: Mon, 15 Apr 2013 07:38:34 -0700
- Subject: Re: Question about madvise(DONTNEED) in glibc malloc
- References: <516ADB3C dot 9040805 at gmail dot com> <m2haj9szhf dot fsf at igel dot home> <516B5588 dot 6030901 at gmail dot com> <mvmk3o4w9fw dot fsf at hawking dot suse dot de>
(4/15/13 12:16 AM), Andreas Schwab wrote:
> KOSAKI Motohiro <kosaki.motohiro@gmail.com> writes:
>
>> % git clone http://repo.or.cz/w/glibc/history.git glibc-history
>
> This is the gitweb address, use git://repo.or.cz/glibc/history instead.
OK. I could see. Thanks a lot.
Ho, Hum. MADV_DONTNEED was introduced following commit. but previous one
is more worse. so, nobody observed any regression. understood. I could
observed "too aggressive shrink" behavior as discussed this thread since
first ptmalloc import. So, I'm quite sure it is not glibc's fault.
commit 218c4301c2550e1254eb1ae51fac0ab1ecaba645
Author: Jakub Jelinek <jakub@redhat.com>
Date: Mon May 7 15:30:57 2007 +0000
* malloc/arena.c (heap_info): Add mprotect_size field, adjust pad.
(new_heap): Initialize mprotect_size.
(grow_heap): When growing, only mprotect from mprotect_size till
new_size if mprotect_size is smaller. When shrinking, use PROT_NONE
MMAP for __libc_enable_secure only, otherwise use MADV_DONTNEED.