This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][RFC] Allow explicit shrinking of arena heaps using anenvironment variable
On Mon, Jul 30, 2012 at 3:17 PM, Rich Felker <dalias@aerifal.cx> wrote:
> On Mon, Jul 30, 2012 at 02:18:58PM -0400, KOSAKI Motohiro wrote:
>> munmap also need tlb shoot down and mmap(MAP_FIXED) region overwritten
>> internally call munmap in kernel. so i don't think tlb shoot down makes
>> performance difference.
>>
>> mmap(MAP_FIXED) and MADV_DONTNEED have different concurrency level.
>> mmap() take a write lock of mmap_sem. MADV_DONTNEED only takes read lock.
>> (note: it's no difference if program is single threaded. mamp_sem is
>> per-process lock)
>
> 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 suspect the latter also needs a write lock on
> mmap_sem.
Right.