Next: About this document ...
Up: Page table setup
Previous: pagetable_init()
This is where the global `mem_map` array is set up and zone information is
added and the `pgdat` structure. It is important that we understand the zoned
buddy allocator before we proceed. So please read the zoned buddy allocator (in
the next section) introduction and come back here.
The mem_map array is set up and the zone list is built here. The algorithm
followed is given here.
- Calculate the total number of pages. i.e, pages in all the zones.
- Calculate the holes present in memory.
- Calculate the actual number of pages using the above two values
(i.e, calculate the difference).
- Check weather mem_map is already allocated. If not
allocate necessary memory (number of pages times the size of 'struct page') from
the bootmem handler.
- Set up other necessary fields in pgdat.
- Reserve all the memory by using the set_page_count and SetPageReserved
calls
- For each zone present,
- Set up the necessary fields in the zone_t structure in pgdat.
- Set up the virtual address for all the pages to the initial value. Once
allocation starts this will start changing as new allocations are made.
- Set up the buddy system bitmaps in the zone.
- Build the allocation fall back lists using the build_zonelist call.
Next: About this document ...
Up: Page table setup
Previous: pagetable_init()
2002-09-22