[PATCH v12 1/2] malloc: add tcache support for large chunk caching

Cupertino Miranda cupertino.miranda@oracle.com
Tue Jul 8 16:38:16 GMT 2025


Just to confirm ... hang still happens after the fix.
Will focus on any code outside USE_TCACHE.

Cheers,
Cupertino

On 08-07-2025 17:06, Cupertino Miranda wrote:
> That certainly is wrong!
> Dammit !
> 
> I am able to reproduce the hang.
> Will fix it and retry!
> 
> Thanks,
> Cupertino
> 
> On 08-07-2025 16:57, Wilco Dijkstra wrote:
>> Hi Cupertino,
>>
>> It looks like you didn't address my comment here (from v9):
>>
>>> +# define TCACHE_SMALL_BINS             64
>>> +# define TCACHE_LARGE_BINS             12 /* Up to 4M chunks */
>>> +# define TCACHE_MAX_BINS       (TCACHE_SMALL_BINS + TCACHE_LARGE_BINS)
>>> +# define MAX_TCACHE_SMALL_SIZE tidx2usize (TCACHE_MAX_BINS-1)
>>>
>>> Small bins surely???
>>>
>>
>> So the committed version uses tcache up to around 1216 bytes instead 
>> of 1036, which
>> would mean the large bins are being used accidentally. This doesn't 
>> seem like it
>> should cause bugs in that there is always another check with 
>> TCACHE_SMALL_BINS for
>> small tcache, however there could be issues in large tcache code.
>>
>> Not sure how it could explain the hang Florian was seeing though, 
>> especially since it
>> apparently still happens with tcache turned off?
>>
>> Cheers,
>> Wilco
> 



More information about the Libc-alpha mailing list