linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Michal Hocko <mhocko@suse.com>,
	"Guilherme G. Piccoli" <gpiccoli@canonical.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>,
	linux-mm@kvack.org, kernel-hardening@lists.openwall.com,
	linux-hardening@vger.kernel.org,
	linux-security-module@vger.kernel.org, kernel@gpiccoli.net,
	cascardo@canonical.com, Alexander Potapenko <glider@google.com>,
	James Morris <jamorris@linux.microsoft.com>,
	Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] mm, hugetlb: Avoid double clearing for hugetlb pages
Date: Wed, 21 Oct 2020 11:50:48 +0200	[thread overview]
Message-ID: <0ad2f879-7c72-3eef-5cb6-dee44265eb82@redhat.com> (raw)
In-Reply-To: <20201021061538.GA23790@dhcp22.suse.cz>

On 21.10.20 08:15, Michal Hocko wrote:
> On Tue 20-10-20 16:19:06, Guilherme G. Piccoli wrote:
>> On 20/10/2020 05:20, Michal Hocko wrote:
>>>
>>> Yes zeroying is quite costly and that is to be expected when the feature
>>> is enabled. Hugetlb like other allocator users perform their own
>>> initialization rather than go through __GFP_ZERO path. More on that
>>> below.
>>>
>>> Could you be more specific about why this is a problem. Hugetlb pool is
>>> usualy preallocatd once during early boot. 24s for 65GB of 2MB pages
>>> is non trivial amount of time but it doens't look like a major disaster
>>> either. If the pool is allocated later it can take much more time due to
>>> memory fragmentation.
>>>
>>> I definitely do not want to downplay this but I would like to hear about
>>> the real life examples of the problem.
>>
>> Indeed, 24s of delay (!) is not so harmful for boot time, but...64G was
>> just my simple test in a guest, the real case is much worse! It aligns
>> with Mike's comment, we have complains of minute-like delays, due to a
>> very big pool of hugepages being allocated.
> 
> The cost of page clearing is mostly a constant overhead so it is quite
> natural to see the time scaling with the number of pages. That overhead
> has to happen at some point of time. Sure it is more visible when
> allocating during boot time resp. when doing pre-allocation during
> runtime. The page fault path would be then faster. The overhead just
> moves to a different place. So I am not sure this is really a strong
> argument to hold.

We have people complaining that starting VMs backed by hugetlbfs takes
too long, they would much rather have that initialization be done when
booting the hypervisor ...

so looks like there is no right or wrong.


-- 
Thanks,

David / dhildenb


  reply	other threads:[~2020-10-21  9:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 18:28 [PATCH] mm, hugetlb: Avoid double clearing for hugetlb pages Guilherme G. Piccoli
2020-10-20  8:20 ` Michal Hocko
2020-10-20 13:36   ` David Hildenbrand
2020-10-20 16:55   ` Mike Kravetz
2020-10-20 19:19   ` Guilherme G. Piccoli
2020-10-20 20:07     ` David Hildenbrand
2020-10-20 20:19       ` Guilherme Piccoli
2020-10-21  6:25         ` Michal Hocko
2020-10-20 20:28       ` David Hildenbrand
2020-10-21  6:15     ` Michal Hocko
2020-10-21  9:50       ` David Hildenbrand [this message]
2020-10-21 11:31         ` Michal Hocko
2020-10-21 23:32           ` Mike Kravetz
2020-10-22  8:04             ` David Hildenbrand
2020-10-22  8:55               ` Michal Hocko
2020-10-23  8:23                 ` David Hildenbrand
2020-11-05 19:37 ` Guilherme G. Piccoli

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=0ad2f879-7c72-3eef-5cb6-dee44265eb82@redhat.com \
    --to=david@redhat.com \
    --cc=cascardo@canonical.com \
    --cc=glider@google.com \
    --cc=gpiccoli@canonical.com \
    --cc=jamorris@linux.microsoft.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=kernel@gpiccoli.net \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mhocko@suse.com \
    --cc=mike.kravetz@oracle.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;
as well as URLs for NNTP newsgroup(s).