[PATCH 3/3] malloc: Increase tcache fill count from 16 to 32

Wilco Dijkstra Wilco.Dijkstra@arm.com
Fri Dec 19 13:28:24 GMT 2025


Hi Florian,

> I wonder if we could lower the fill count to 20 and use four fifth as
> the malloc fill target (which would be equal to 16 once more).  That
> would reduce the risk of excessive tcache retention due to doubling the
> tcache size.

>From SPECINT runs it seems tcache_count=24 gives almost the same performance
as 32, so we could use that. Bench-malloc-simple is significantly slower than 32.

It should be relatively easy to make this adaptive and empty tcache more if it is
repeatedly full. Similar for filling. Being a bit smarter means we could significantly
increase tcache counts. There is likely a good benefit from tcache_count=128 for
small chunks while keeping the limit at 16 for 1KB chunks.

Cheers,
Wilco



More information about the Libc-alpha mailing list