Linux Kernel Architecture

(Jacob Rumans) #1

Chapter3:MemoryManagement


pg_data_t
ZONELIST

Z
O
N
E
S

pg_data_t
ZONELIST

Z
O
N
E
S

pg_data_t
ZONELIST

Z
O
N
E
S

Page Tables


Figure 3-3: Memory partitioning in NUMA systems.

The kernel introduces the following constants to enumerate all zones in the system:

<mmzone.h>
enum zone_type {
#ifdef CONFIG_ZONE_DMA
ZONE_DMA,
#endif
#ifdef CONFIG_ZONE_DMA32
ZONE_DMA32,
#endif
ZONE_NORMAL,
#ifdef CONFIG_HIGHMEM
ZONE_HIGHMEM,
#endif
ZONE_MOVABLE,
MAX_NR_ZONES
};

❑ ZONE_DMAfor DMA-suitable memory. The size of thisregion depends on the processor type. ON
IA-32 machines, the limit is the classical 16 MiB boundary imposed by ancient ISA devices. But
also, more modern machines can be affected by this.
❑ ZONE_DMA32for DMA-suitable memory in a 32-bit addressable area. Obviously, there is only a
difference between the two DMA alternatives on 64-bit systems. On 32-bit machines, this zone
is empty; that is, its size is 0 MiB. On Alphas and AMD64 systems, for instance, this zone ranges
from 0 to 4 GiB.
❑ ZONE_NORMALfor normal memory mapped directly in the kernel segment. This is the only zone
guaranteed to be possible present on all architectures. It is, however, not guaranteed that the
zone must be equipped with memory. If, for instance, an AMD64 system has 2 GiB of RAM, then
all of it will belong toZONE_DMA32,andZONE_NORMALwill be empty.
❑ ZONE_HIGHMEMfor physical memory that extends beyond the kernel segment.
Free download pdf