|
Buddy算法中的zone->free_list是何时实始化的?
只在free_area_init_core()中看到INIT_LIST_HEAD(&zone->free_area.free_list),但是何时真正把page插到zone->free_list中的?或者是alloc_page()时才把page插到free_list的?
free_area_init_core():
......................
for (i = 0; ; i++) {
unsigned long bitmap_size;
INIT_LIST_HEAD(&zone->free_area.free_list);
if (i == MAX_ORDER-1) {
zone->free_area.map = NULL;
break;
}
bitmap_size = (size-1) >> (i+4);
bitmap_size = LONG_ALIGN(bitmap_size+1);
zone->free_area.map =
(unsigned long *) alloc_bootmem_node(pgdat, bitmap_size);
} |
|