Freeing page table pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Here is pagetable free function from x86 architecture (arch/x86/mm/init_64.c)

static void __meminit free_pagetable(struct page *page, int order)
{
	unsigned long magic;
	unsigned int nr_pages = 1 << order;

	/* bootmem page has reserved flag */
	if (PageReserved(page)) {
		__ClearPageReserved(page);

		magic = (unsigned long)page->freelist;
		if (magic == SECTION_INFO || magic == MIX_SECTION_INFO) {
			while (nr_pages--)
				put_page_bootmem(page++);
		} else
			while (nr_pages--)
				free_reserved_page(page++);
	} else
		free_pages((unsigned long)page_address(page), order);
}

Since all kernel pagetable pages allocated during boot from memblock should
have been marked with MIX_SECTION_INFO through the following function calls,
wondering in which case if (magic == SECTION_INFO || magic == MIX_SECTION_INFO)
will evaluate to be false and will directly call free_reserved_page() instead.

Inside register_page_bootmem_memmap() (arch/x86/mm/init_64.c)

get_page_bootmem(section_nr, pgd_page(*pgd), MIX_SECTION_INFO);
get_page_bootmem(section_nr, p4d_page(*p4d), MIX_SECTION_INFO);
get_page_bootmem(section_nr, pud_page(*pud), MIX_SECTION_INFO);
get_page_bootmem(section_nr, pte_page(*pte), SECTION_INFO);

- Anshuman




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux