[PATCH][RFC] Allow explicit shrinking of arena heaps using an environment variable
Rich Felker
dalias@aerifal.cx
Mon Jul 30 19:18:00 GMT 2012
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). I suspect the latter also needs a write lock on
mmap_sem.
Rich
More information about the Libc-alpha
mailing list