[PATCH] malloc: Prevent arena free_list from turning cyclic [BZ #19048]

Florian Weimer fweimer@redhat.com
Tue Oct 13 11:09:00 GMT 2015


On 10/09/2015 11:29 PM, Paulo César Pereira de Andrade wrote:

> more threads then arenas, will cause it to cycle in the next pointer,
> until there are less threads than arenas, in which case,  the
> next_free pointer would become close to useless, as well as the
> reference counter, because they would seldomly be used.

I believe this was the original intent, though.  free_list is supposed
to be a source of likely uncontended arenas, which is why arenas are
taken from free_list first.

The free_list fallback will be used if threads exit and are started
again, so it depends on the application how often this happens and if
this arena selection logic is beneficial.

Florian



More information about the Libc-alpha mailing list