Principal data structures that are elementary for entire memory management framework are zones and nodes. Let's familiarize ourselves with core concepts behind these data structures.
For efficient management of memory allocations, physical pages are organized into groups called zones. Pages in each zone are utilized for specific needs like DMA, high memory, and other regular allocation needs. An enum
in kernel header mmzone.h
declares zone constants:
/* include/linux/mmzone.h */ enum zone_type { #ifdef CONFIG_ZONE_DMA ZONE_DMA, #endif #ifdef CONFIG_ZONE_DMA32 ZONE_DMA32, #endif #ifdef CONFIG_HIGHMEM ZONE_HIGHMEM, #endif ZONE_MOVABLE, #ifdef CONFIG_ZONE_DEVICE ZONE_DEVICE, #endif __MAX_NR_ZONES };
ZONE_DMA
:
Pages in this zone are reserved for devices which cannot initiate DMA on all addressable memory. Size of this zone is architecture specific:
Architecture | Limit |
parsic, ia64, sparc | <4G |
s390 | <2G |
ARM | variable |
alpha | unlimited or <16MB |
alpha, i386, x86-64 | <16MB... |