This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] malloc: Prevent arena free_list from turning cyclic [BZ #19048]
- From: Florian Weimer <fweimer at redhat dot com>
- To: Paulo CÃsar Pereira de Andrade <paulo dot cesar dot pereira dot de dot andrade at gmail dot com>, Siddhesh Poyarekar <sid at reserved-bit dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 13 Oct 2015 13:09:53 +0200
- Subject: Re: [PATCH] malloc: Prevent arena free_list from turning cyclic [BZ #19048]
- Authentication-results: sourceware.org; auth=none
- References: <5617E843 dot 3060504 at redhat dot com> <5618075F dot 105 at reserved-bit dot com> <561807D9 dot 2080604 at reserved-bit dot com> <CAHAq8pEwixEpB0=uxxCw3PVQF3Pwt_tWfrRKMGWVa86zJNBuyQ at mail dot gmail dot com>
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