[PATCH 0/9] malloc: Remove fastbins
Florian Weimer
fw@deneb.enyo.de
Sun Nov 9 06:40:08 GMT 2025
* Dev Jain:
>> Paulo had some concerns about the queuing behavior in __libc_free on a
>> full tcache. Then we realized that we currently do not batch frees,
>> which is quite straightforward to implement. Batching also addresses
>> Paulo's concerns about FIFO violations. The second patch below
>
> What do you mean by FIFO violations, could you elaborate?
Eh, LIFO violations: Once tcache is full, frees go straight to the
low-level allocator, and are thus reordered relative to the
allocations in tcache.
>> implements a hysteresis effect for malloc, too, so that malloc + free
>> does not immediately flush the tcache. Average utilization of the
>> tcache should be lower after these changes, hopefully with better
>> performance.
>>
>> Dev Jain, could you rerun your performance experiments with these two
>> extra patches?
>
> Thanks for the patches! My long term goal was to increase the tcache count
> even more, and implement a tcache flushing algorithm. We could either have
> a timer upon the expiration of which we could flush it, or if the tcache
> grows beyond a particular size, we could flush it, and we can put this
> code in the malloc() path. But what you have implemented seems pretty
> nice and low overhead. I'll check with these patches...
Thanks!
More information about the Libc-alpha
mailing list