First page Back Continue Last page Overview Graphics
kmalloc allocator
The kmalloc allocator is the general purpose memory allocator in the Linux kernel, for objects from 8 bytes to 128 KB
For small sizes, it relies on generic SLAB caches, named kmalloc-XXX in /proc/slabinfo
For larger sizes, it relies on the page allocator
The allocated area is guaranteed to be physically contiguous
The allocated area size is rounded up to the next power of two size (while using the SLAB allocator directly allows to have more flexibility)
It uses the same flags as the page allocator (GFP_KERNEL, GFP_ATOMIC, GFP_DMA, etc.) with the same semantics.
Should be used as the primary allocator unless there is a strong reason to use another one.