[PATCH v3 0/5] malloc: tcache improvements

Cupertino Miranda cupertino.miranda@oracle.com
Thu Jan 2 19:15:05 GMT 2025


Hi everyone,

In this version I have decided to redesign the implementation to better
fit current tcache code.
This significantly improved readibility and simplicity of the patch,
making it also rather an evolution to the existing code, instead of a side
implementation.
Please notice that it is still a step towards what should be a
complete implementation. Next steps would be to preload tcache with a
big chunk and then allow tcaches to split or consolidate chunks within
malloc or free calls.

Patches 1 to 3 are rather fixes/improvements to existing malloc code.
Patch nr3 has already been submitted as a general patch and is awaiting
review.

Looking forward to your comments.

Best regards,
Cupertino

Changes from v2:
 - Redesign implementation.
 - Dropped strategy to remove old chunks from tcache to a better
   split and consolidate strategy (future patch, still work in
   progress).
 - Fixed regressions in v2. 
Changes from v1:
 - Typo in the assigment to mp_.tcache_bins in do_set_cache_max
   function. Was setting it to MAX_TCACHE_SIZE instead of
   TCACHE_MAX_BINS.
 - Fixed testsuite regressions.

Cupertino Miranda (5):
  malloc: missing initialization of tcache in _mid_memalign
  malloc: mangle tcache entries pointers
  malloc: replace _int_free by _int_free_chunk in sysmalloc.
  malloc: add tcache support for large chunk caching
  malloc: add testing for large tcache support.

 Rules           |  19 +++++++
 malloc/Makefile |  15 ++++++
 malloc/malloc.c | 130 ++++++++++++++++++++++++++++++++----------------
 3 files changed, 121 insertions(+), 43 deletions(-)

-- 
2.39.5



More information about the Libc-alpha mailing list