In the patch below, isn't there a bootmem page leak in case !pmd_none(*pmd)?
> diff -urN linux-bk/arch/i386/mm/init.c linux/arch/i386/mm/init.c
> --- linux-bk/arch/i386/mm/init.c Tue Jul 30 20:59:27 2002
> +++ linux/arch/i386/mm/init.c Tue Jul 30 21:02:41 2002
> @@ -70,10 +70,14 @@
> */
> static pte_t * __init one_page_table_init(pmd_t *pmd)
> {
> - pte_t *page_table = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
> - set_pmd(pmd, __pmd(__pa(page_table) | _KERNPG_TABLE));
> - if (page_table != pte_offset_kernel(pmd, 0))
> - BUG();
> + pte_t *page_table;
> + page_table = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
> + if (pmd_none(*pmd)) {
> + set_pmd(pmd, __pmd(__pa(page_table) | _KERNPG_TABLE));
> + if (page_table != pte_offset_kernel(pmd, 0))
> + BUG();
> + } else
> + page_table = pte_offset_kernel(pmd, 0);
>
> return page_table;
> }
> @@ -107,9 +111,7 @@
>
> pmd = pmd_offset(pgd, vaddr);
> for (; (pmd_ofs < PTRS_PER_PMD) && (vaddr != end); pmd++, pmd_ofs++) {
> - if (pmd_none(*pmd))
> - one_page_table_init(pmd);
> -
> + one_page_table_init(pmd);
> vaddr += PMD_SIZE;
> }
> pmd_ofs = 0;
-- Dan Aloni da-x@gmx.net - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/