int __init find_pernode_space (unsigned long start, unsigned long len, int node);
This routine reserves space for the per-cpu data struct, the list of pg_data_ts and the per-node data struct. Each node will have something like the following in the first chunk of addr. space large enough to hold it.
________________________ | | |~~~~~~~~~~~~~~~~~~~~~~~~| <-- NODEDATA_ALIGN(start, node) for the first | PERCPU_PAGE_SIZE * | start and length big enough | cpus_on_this_node | Node 0 will also have entries for all non-existent cpus. |------------------------| | local pg_data_t * | |------------------------| | local ia64_node_data | |------------------------| | ??? | |________________________|
Once this space has been set aside, the bootmem maps are initialized. We could probably move the allocation of the per-cpu and ia64_node_data space outside of this function and use alloc_bootmem_node, but doing it here is straightforward and we get the alignments we want so...