How is Linux kernel free_list initialized to point to free pages?

I'm trying to figure out how free_list

(free_area zones) points to different free pages in the Linux kernel. Can anyone explain how and where in the kernel code and how they are initialized? It seems, looking at the kernel code, the only initialization free_list

in the code is in zone_init_free_lists()

the kernel function / mm / page _alloc.c:

for_each_migratetype_order(order, t) { 
INIT_LIST_HEAD(&zone->free_area[order].free_list[t]);
                          zone->free_area[order].nr_free = 0; 
}   

      

from this code free_list

don't point to the free_pages block? ** Any help would be greatly appreciated. **

+3


source to share


1 answer


I got how pages are added to the free list, here is the flow of functions from start_kernel ().

       start_kernel();
       mm_init()
       mem_init()
       free_all_bootmem()
       free_all_bootmem_core()
       free_all_bootmem_core()
       __free_pages()
       __free_pages_ok()
       free_one_page()
       __free_one_page()

      



Thank.

+2


source







All Articles