lkml.org 
[lkml]   [2018]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: hugetlb: don't zero 1GiB bootmem pages.
On Wed 11-07-18 14:47:11, Michal Hocko wrote:
> On Tue 10-07-18 11:49:03, Cannon Matthews wrote:
> > When using 1GiB pages during early boot, use the new
> > memblock_virt_alloc_try_nid_raw() function to allocate memory without
> > zeroing it. Zeroing out hundreds or thousands of GiB in a single core
> > memset() call is very slow, and can make early boot last upwards of
> > 20-30 minutes on multi TiB machines.
> >
> > To be safe, still zero the first sizeof(struct boomem_huge_page) bytes
> > since this is used a temporary storage place for this info until
> > gather_bootmem_prealloc() processes them later.
> >
> > The rest of the memory does not need to be zero'd as the hugetlb pages
> > are always zero'd on page fault.
> >
> > Tested: Booted with ~3800 1G pages, and it booted successfully in
> > roughly the same amount of time as with 0, as opposed to the 25+
> > minutes it would take before.
>
> The patch makes perfect sense to me. I wasn't even aware that it
> zeroying memblock allocation. Thanks for spotting this and fixing it.
>
> > Signed-off-by: Cannon Matthews <cannonmatthews@google.com>
>
> I just do not think we need to to zero huge_bootmem_page portion of it.
> It should be sufficient to INIT_LIST_HEAD before list_add. We do
> initialize the rest explicitly already.

Forgot to mention that after that is addressed you can add
Acked-by: Michal Hocko <mhocko@suse.com>

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2018-07-11 14:48    [W:0.037 / U:1.884 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site