Kernel dynamic memory allocation tracking and reduction
- kernel dynamic memory allocation tracking and reduction
- Tim Bird, Sony Network Entertainment
The purpose of this project is to identify (and hopefully reduce) extraneous dynamic memory allocations by the Linux kernel, in an effort to reduce overall the runtime kernel memory footprint. For systems with less than 4M, this is still important.
This project would consist of identifying kernel dynamic memory allocations, and "wasted areas" due to memory fragmentation, bad fit between requested and provided memory areas, and overhead caused by the allocator itself. The goal would be to determine which parts of the Linux kernel allocated too much memory, or wasted memory through fragmentation or inefficiency, and to improve them.
Other efforts, to identify and optimize static memory utilization are well-know and still available. Linux-tiny used to have a patch which implemented the slab memory allocator, to provide detailed information about each caller of kmalloc and kmem_cache_alloc(). It would be nice to revive this work, and use it to improve the memory footprint of the kernel.
- /proc/slabinfo and tools/vm/slabinfo
- does tools/vm/slabinfo cross-compile?
- CONFIG_DEBUG_PAGEALLOC and CONFIG_DEBUG_SLAB and CONFIG_TRACING
- does tracing, with appropriate event capture, and a post-processing tool, accomplish what is needed?
- see slob-accounting.patch at: http://elinux.org/index.php?title=Linux_Tiny_Patch_Details
- CONFIG_DEBUG_SLOB_ACCOUNT and CONFIG_KMALLOC_ACCOUNTING
- Tim has an updated, but never published patches:
- /proc/cache_account, casort, slabalyze
- /proc/kmalloc-accounting (replaced by cache_account?)
None so far