[PATCH] malloc: Preseve arena free list for attached threads [BZ #20370]
Florian Weimer
fweimer@redhat.com
Tue Jul 19 20:36:00 GMT 2016
On 07/19/2016 08:35 PM, Carlos O'Donell wrote:
> OK. This should really be an infrequent operation triggered only by
> failing allocations in your main arena e.g. arena_get_retry, or as a thread
> is started up and looking for a free list. I would imagine that the cost of
> this linear list walk (which grows by CPU count) would be nothing compared to
> the cost of starting up and tearing down threads.
NB: Note that this only happens after the current thread lost a race
towards the free list, and some other thread exited between the point
where the current thread observed the free list as empty (because
otherwise the current thread would have picked an arena from the
non-empty free list), and the current thread attaches itself to the
selected arena.
Florian
More information about the Libc-alpha
mailing list