[PATCH 0/3] malloc: batched frees
Florian Weimer
fweimer@redhat.com
Tue May 12 07:29:32 GMT 2026
* Florian Weimer:
> This series implements batched frees for malloc. They amortize the
> locking overhead for frees once tcache is full.
Running some benchmarks, this approach does not show the expected
performance gains. There are some striking improvements for sh6bench
and sh8bench, though.
I also tried sorting the batch before freeing, but somehow that made it
worse.
At least I need to remove the locking from the single-threaded case. I
should merge the chunks before freeing into the main allocator: if all
chunks in tcache are adjacent, we only need to create one new chunk.
Otherwise, repeatedly merging chunks is quite costly because they
need to move between bin lists, too.
Thanks,
Florian
More information about the Libc-alpha
mailing list