Kmalloc caches

Slab allocator maintains a set of generic slab caches to cache memory blocks of unit sizes in multiples of 8. It maintains two sets of slab caches for each unit size, one to maintain a pool of memory blocks allocated from ZONE_NORMAL pages and another from ZONE_DMA pages. These caches are global and shared by all kernel code. Users can track the status of these caches through a special file /proc/slabinfo. Kernel services can allocate and release memory blocks from these caches through the kmalloc family of routines. They are referred to as kmalloc caches:

#cat /proc/slabinfo slabinfo - version: 2.1# name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> : tunables <limit> <batchcount> <sharedfactor> : slabdata ...

Get Mastering Linux Kernel Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.