[PATCH][RFC] Allow explicit shrinking of arena heaps using an environment variable

Roland McGrath roland@hack.frob.com
Fri Jul 20 22:23:00 GMT 2012


Like Carlos, I want to hear about the motivation for this.  I really
don't like adding to the plethora of environment variables and other
knobs affecting malloc.  We have too many of those as it is.

The reason we're doing this in secure mode is clear to me.  If in
practice the performance of the mmap is not significantly worse than
the madvise on then I'd say we should do it unconditionally just to
reduce the number of code paths regardless of all else.  Off hand
that seems plausible.  Looking at recent Linux sources, I think the
kernel will do the TLB shoot-down (which I think is the expensive
thing) immediately on madvise.  So I think Siddhesh should do some
empirical performance tests to compare the mmap and madvise paths
and report back.


Thanks,
Roland



More information about the Libc-alpha mailing list