linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: David Rientjes <rientjes@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mel Gorman <mgorman@suse.de>,
	"Kirill A. Shutemov" <kirill@shutemov.name>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux-MM <linux-mm@kvack.org>
Subject: Re: [rfc] mm, hugetlb: allow hugepage allocations to excessively reclaim
Date: Fri, 4 Oct 2019 11:28:08 +0200	[thread overview]
Message-ID: <20191004092808.GC9578@dhcp22.suse.cz> (raw)
In-Reply-To: <alpine.DEB.2.21.1910031243050.88296@chino.kir.corp.google.com>

On Thu 03-10-19 12:52:33, David Rientjes wrote:
> On Thu, 3 Oct 2019, Vlastimil Babka wrote:
> 
> > I think the key differences between Mike's tests and Michal's is this part
> > from Mike's mail linked above:
> > 
> > "I 'tested' by simply creating some background activity and then seeing
> > how many hugetlb pages could be allocated. Of course, many tries over
> > time in a loop."
> > 
> > - "some background activity" might be different than Michal's pre-filling
> >   of the memory with (clean) page cache
> > - "many tries over time in a loop" could mean that kswapd has time to 
> >   reclaim and eventually the new condition for pageblock order will pass
> >   every few retries, because there's enough memory for compaction and it
> >   won't return COMPACT_SKIPPED
> > 
> 
> I'll rely on Mike, the hugetlb maintainer, to assess the trade-off between 
> the potential for encountering very expensive reclaim as Andrea did and 
> the possibility of being able to allocate additional hugetlb pages at 
> runtime if we did that expensive reclaim.

That tradeoff has been expressed by __GFP_RETRY_MAYFAIL which got broken
by b39d0ee2632d.

> For parity with previous kernels it seems reasonable to ask that this 
> remains unchanged since allocating large amounts of hugetlb pages has 
> different latency expectations than during page fault.  This patch is 
> available if he'd prefer to go that route.
> 
> On the other hand, userspace could achieve similar results if it were to 
> use vm.drop_caches and explicitly triggered compaction through either 
> procfs or sysfs before writing to vm.nr_hugepages, and that would be much 
> faster because it would be done in one go.  Users who allocate through the 
> kernel command line would obviously be unaffected.

Requesting the userspace to drop _all_ page cache in order allocate a
number of hugetlb pages or any other affected __GFP_RETRY_MAYFAIL
requests is simply not reasonable IMHO.
-- 
Michal Hocko
SUSE Labs


  reply	other threads:[~2019-10-04  9:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02 23:03 [rfc] mm, hugetlb: allow hugepage allocations to excessively reclaim David Rientjes
2019-10-02 23:37 ` Linus Torvalds
2019-10-03  5:00   ` Michal Hocko
2019-10-03  5:27 ` Michal Hocko
2019-10-03  8:14 ` Vlastimil Babka
2019-10-03 19:52   ` David Rientjes
2019-10-04  9:28     ` Michal Hocko [this message]
2019-10-04 18:02       ` David Rientjes
2019-10-07 22:15         ` Mike Kravetz

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=20191004092808.GC9578@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mike.kravetz@oracle.com \
    --cc=rientjes@google.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vbabka@suse.cz \
    /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).