Linux Kernel Architecture

(Jacob Rumans) #1

Chapter3:MemoryManagement


be constructed from this information. Recall that architectures are required to established the following
information during boot:

❑ The page frame boundaries of the various zones in the system as stored in themax_zone_pfn
array.
❑ The distribution of page frames across nodes as stored in the global variableearly_node_map.

ManagingData Structure Creation


Starting with kernel 2.6.10, a generic framework was provided to transfer this information into the node
and zone data structures expected by the buddy system; before this, each architecture had to set up the
structures on its own. Today, it suffices to set up the aforementioned simple structures and leave the hard
work tofree_area_init_nodes. Figure 3-27 shows an overview of the process, and Figure 3-28 shows
the code flow diagram forfree_area_init_nodes.

free_area_init_nodes

Fill in pg_data_t
early_node_map

Architecture-Specific Setup


initialization

Set max page
frame numbers
for zones
(max_zone_pfns)

pg_data_t

Generic representation
of nodes and zones

Figure 3-27: Overview of the interplaybetween architecture-specific and
generic kernel code for setting up node and zone data memory management
data structures.

Determine zone
boundaries

Iterate over all nodes

free_area_init_nodes

free_area_init_node
calculate_node_totalpages

alloc_node_mem_map

free_area_init_core

check_for_regular_memory
Figure 3-28: Code flow diagram for
free_area_init_nodes.
Free download pdf