From: Mike Kravetz <mike.kravetz@oracle.com>
To: Michal Hocko <mhocko@kernel.org>,
Cannon Matthews <cannonmatthews@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Nadia Yvette Chambers <nyc@holomorphy.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
andreslc@google.com, pfeiner@google.com, dmatlack@google.com,
gthelen@google.com
Subject: Re: [PATCH] mm: hugetlb: don't zero 1GiB bootmem pages.
Date: Wed, 11 Jul 2018 09:47:25 -0700 [thread overview]
Message-ID: <3f639e81-f8d2-5010-4a4b-331d198b1ce9@oracle.com> (raw)
In-Reply-To: <20180711124801.GO20050@dhcp22.suse.cz>
On 07/11/2018 05:48 AM, Michal Hocko wrote:
> 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>
Cannon,
How about if you make this change suggested by Michal, and I will submit
a separate patch to revert the patch which added the phys field to
huge_bootmem_page structure.
FWIW,
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
--
Mike Kravetz
prev parent reply other threads:[~2018-07-11 16:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-10 18:49 Cannon Matthews
2018-07-10 20:46 ` Mike Kravetz
2018-07-11 12:49 ` Michal Hocko
2018-07-11 12:47 ` Michal Hocko
2018-07-11 12:48 ` Michal Hocko
2018-07-11 16:47 ` Mike Kravetz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3f639e81-f8d2-5010-4a4b-331d198b1ce9@oracle.com \
--to=mike.kravetz@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=andreslc@google.com \
--cc=cannonmatthews@google.com \
--cc=dmatlack@google.com \
--cc=gthelen@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=nyc@holomorphy.com \
--cc=pfeiner@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox