Re: [PATCH] mm, x86: no zeroing of hugetlbfs pages at boot

From: Michal Hocko
Date: Thu Mar 14 2013 - 04:51:51 EST


On Wed 06-03-13 15:50:20, Cliff Wickman wrote:
[...]
> I propose passing a flag to the early allocator to indicate that no zeroing
> of a page should be done. The 'no zeroing' flag would have to be passed
> down this code path:
>
> hugetlb_hstate_alloc_pages
> alloc_bootmem_huge_page
> __alloc_bootmem_node_nopanic NO_ZERO (nobootmem.c)
> __alloc_memory_core_early NO_ZERO
> if (!(flags & NO_ZERO))
> memset(ptr, 0, size);
>
> Or this path if CONFIG_NO_BOOTMEM is not set:
>
> hugetlb_hstate_alloc_pages
> alloc_bootmem_huge_page
> __alloc_bootmem_node_nopanic NO_ZERO (bootmem.c)
> alloc_bootmem_core NO_ZERO
> if (!(flags & NO_ZERO))
> memset(region, 0, size);
> __alloc_bootmem_nopanic NO_ZERO
> ___alloc_bootmem_nopanic NO_ZERO
> alloc_bootmem_core NO_ZERO
> if (!(flags & NO_ZERO))
> memset(region, 0, size);

Yes, the patch makes sense. I just think it make unnecessary churn.
Can we just add __alloc_bootmem_node_nopanic_nozero and hide the flag
downwards the call chain so that we do not have to touch all
__alloc_bootmem_node_nopanic callers?

Thanks

> Signed-off-by: Cliff Wickman <cpw@xxxxxxx>
>
> ---
> arch/x86/kernel/setup_percpu.c | 4 ++--
> include/linux/bootmem.h | 23 ++++++++++++++++-------
> mm/bootmem.c | 12 +++++++-----
> mm/hugetlb.c | 3 ++-
> mm/nobootmem.c | 41 +++++++++++++++++++++++------------------
> mm/page_cgroup.c | 2 +-
> mm/sparse.c | 2 +-
> 7 files changed, 52 insertions(+), 35 deletions(-)
>
[...]
--
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/