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_nodesFill in pg_data_t
early_node_mapArchitecture-Specific Setup
initializationSet max page
frame numbers
for zones
(max_zone_pfns)pg_data_tGeneric representation
of nodes and zonesFigure 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
boundariesIterate over all nodesfree_area_init_nodesfree_area_init_node
calculate_node_totalpagesalloc_node_mem_mapfree_area_init_corecheck_for_regular_memory
Figure 3-28: Code flow diagram for
free_area_init_nodes.