From: Rik van Riel <riel@surriel.com>
To: Michal Hocko <mhocko@kernel.org>, Roman Gushchin <guro@fb.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
linux-mm@kvack.org, kernel-team@fb.com,
linux-kernel@vger.kernel.org,
Mike Kravetz <mike.kravetz@oracle.com>
Subject: Re: [PATCH v2] mm: hugetlb: optionally allocate gigantic hugepages using cma
Date: Sun, 15 Mar 2020 21:08:33 -0400 [thread overview]
Message-ID: <3f9ebf02d5ac99b4a53323cc81097ab7d176be13.camel@surriel.com> (raw)
In-Reply-To: <20200310173738.GW8447@dhcp22.suse.cz>
[-- Attachment #1: Type: text/plain, Size: 1416 bytes --]
On Tue, 2020-03-10 at 18:37 +0100, Michal Hocko wrote:
> On Tue 10-03-20 10:25:59, Roman Gushchin wrote:
> > Well, so far I was focused on a particular case when the target cma
> > size
> > is significantly smaller than the total RAM size (~5-10%). What is
> > the right
> > thing to do here? Fallback to the current behavior if the requested
> > size is
> > more than x% of total memory? 1/2? How do you think?
>
> I would start by excluding restricted kernel zones (<ZONE_NORMAL).
> Cutting off 1G of ZONE_DMA32 might be a real problem.
It looks like memblock_find_in_range_node(), which
is called from memblock_alloc_range_nid(), will already
do top-down allocation inside each node.
However, looking at that code some more, it has some
limitations that we might not want. Specifically, if
we want to allocate for example a 16GB CMA area, but
the node in question only has a 15GB available area
in one spot and a 1GB available area in another spot,
for example due to memory holes, the allocation will fail.
I wonder if it makes sense to have separate cma_declare_contiguous
calls for each 1GB page we set up. That way it will be easier
to round-robin between the ZONE_NORMAL zones in each node, and
also to avoid the ZONE_DMA32 and other special nodes on systems
where those are a relatively small part of memory.
I'll whip up a patch to do that.
--
All Rights Reversed.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-03-16 1:09 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-10 0:25 [PATCH v2] mm: hugetlb: optionally allocate gigantic hugepages using cma Roman Gushchin
2020-03-10 0:30 ` Roman Gushchin
2020-03-10 8:45 ` Michal Hocko
2020-03-10 17:25 ` Roman Gushchin
2020-03-10 17:37 ` Michal Hocko
2020-03-16 1:08 ` Rik van Riel [this message]
2020-03-10 17:38 ` Mike Kravetz
2020-03-10 17:42 ` Michal Hocko
2020-03-10 9:01 ` Michal Hocko
2020-03-10 17:30 ` Roman Gushchin
2020-03-10 17:39 ` Michal Hocko
2020-03-10 17:58 ` Roman Gushchin
2020-03-10 17:27 ` Mike Kravetz
2020-03-10 18:05 ` Roman Gushchin
2020-03-10 18:22 ` Rik van Riel
2020-03-10 18:33 ` Mike Kravetz
2020-03-10 18:54 ` Andreas Schaufler
2020-03-10 18:56 ` Roman Gushchin
2020-03-10 19:00 ` Andreas Schaufler
2020-03-10 19:19 ` Roman Gushchin
2020-03-10 19:36 ` Michal Hocko
2020-03-10 19:46 ` Rik van Riel
2020-03-10 20:11 ` Mike Kravetz
2020-03-10 20:15 ` Rik van Riel
2020-03-10 20:29 ` Mike Kravetz
2020-03-10 20:38 ` Rik van Riel
2020-03-10 20:29 ` Roman Gushchin
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=3f9ebf02d5ac99b4a53323cc81097ab7d176be13.camel@surriel.com \
--to=riel@surriel.com \
--cc=akpm@linux-foundation.org \
--cc=guro@fb.com \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--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).