Page corloring: Preparation
时间:2010-10-25 来源:letmego163
STEP 1:
How is the zone be initiated?
start_kernel() > setup_arch() > paging init() > zone_sizes_init() > free_area_init_nodes() > free_area_init_node() > free_area_init_core() > init_currently_empty_zone() > zone_init_free_lists()
static void __meminit zone_init_free_lists(struct zone *zone) |
__meminit int init_currently_empty_zone(struct zone *zone, |
STEP 2:
The kernel performs optimization if only a single page is to be allocated, that is, if the allocation order is 0 because 2^0 = 1. The page is not taken directly from the buddy system but from the per-CPU page cache.
STEP 3:
For buddy system, there are two helper function, which are the core of buddy system. They are:
buffered_rmqueue() and __rmqueue().
STEP 3:
related function, __free_one_page(), expand(), __rmqueue_smallest(), __rmqueue_fallback(), free_pages(), zone_init_free_lists().