Reputation: 1975
I am trying to understand how free_list
(of free_area of zones) to points different free pages in the Linux kernel. Can anybody explain how and where in kernel code and how they get initialized?
It seems from looking through the kernel code that the only initialization of free_list
in code is in zone_init_free_lists()
function of kernel/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
are not pointing to free_pages block ??**
Any help will be greatly appreciated .**
Upvotes: 4
Views: 541
Reputation: 1975
i got how pages gets added in free list here is function flow 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()
Thanks.
Upvotes: 2