git: libc: nmalloc - Add a per-thread magazine layer and a malloc slab magazine.
vsrinivas at crater.dragonflybsd.org
Thu Sep 9 04:00:10 PDT 2010
Author: Venkatesh Srinivas <me at endeavour.zapto.org>
Date: Thu Sep 9 03:51:28 2010 -0700
libc: nmalloc - Add a per-thread magazine layer and a malloc slab magazine.
The per-thread magazine layer is based on the Solaris umem/vmem paper; it
creates fixed-sized arrays ('magazines') of buffers and binds them to threads.
Local allocations can often now occur with minimal locking and interference.
The slab magazine is meant to buffer calls calls to mmap when requesting slabs.
In tests with MySQL/sysbench OLTP, it leads to fairly dramatic reductions in
the total number of mmap system calls.
nmalloc now also respects the MALLOC_OPTIONS environment variable:
- The 'U' option generates ktrace entries for all malloc/realloc/free calls
- The 'H' option calls madvise liberally to return pages to the system often
- The 'Z' option zeroes all allocations
This work was developed out-of-tree; the RCS log is on leaf.
Summary of changes:
lib/libc/stdlib/nmalloc.c | 711 ++++++++++++++++++++++++++++++++++++++-------
1 files changed, 599 insertions(+), 112 deletions(-)
DragonFly BSD source repository
More information about the Commits