From: Mike Kravetz <mike.kravetz@oracle.com>
To: David Hildenbrand <david@redhat.com>
Cc: David Rientjes <rientjes@google.com>,
Josh Triplett <josh@joshtriplett.org>,
Andrew Morton <akpm@linux-foundation.org>,
Muchun Song <muchun.song@linux.dev>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH] mm: hugetlb: Add Kconfig option to set default nr_overcommit_hugepages
Date: Mon, 12 Jun 2023 09:42:05 -0700 [thread overview]
Message-ID: <20230612164205.GA3704@monkey> (raw)
In-Reply-To: <fd1c3a84-d3e6-906f-57b0-25eae0933b68@redhat.com>
On 06/12/23 11:12, David Hildenbrand wrote:
> On 11.06.23 07:20, David Rientjes wrote:
> > On Fri, 9 Jun 2023, Josh Triplett wrote:
> >
> > > The default kernel configuration does not allow any huge page allocation
> > > until after setting nr_hugepages or nr_overcommit_hugepages to a
> > > non-zero value; without setting those, mmap attempts with MAP_HUGETLB
> > > will always fail with -ENOMEM. nr_overcommit_hugepages allows userspace
> > > to attempt to allocate huge pages at runtime, succeeding if the kernel
> > > can find or assemble a free huge page.
> > >
> > > Provide a Kconfig option to make nr_overcommit_hugepages default to
> > > unlimited, which permits userspace to always attempt huge page
> > > allocation on a best-effort basis. This makes it easier and more
> > > worthwhile for random applications and libraries to opportunistically
> > > attempt MAP_HUGETLB allocations without special configuration.
> > >
> > > In particular, current versions of liburing with IORING_SETUP_NO_MMAP
> > > attempt to allocate the rings in a huge page. This seems likely to lead
> > > to more applications and libraries attempting to use huge pages.
> > >
> > > Signed-off-by: Josh Triplett <josh@joshtriplett.org>
> >
> > Why not do this in an initscript?
> >
> > Or, if absolutely necessary, a kernel command line parameter?
> >
> > A Kconfig option to set a default value to be ULONG_MAX seems strange if
> > you can just write the value to procfs.
> >
>
> Agreed, not to mention that huge pages in some environment can cause trouble
> (some architectures -- or with gigantic huge pages -- don't support huge
> page migration and you can run into trouble with ZONE_MOVABLE or
> MIGRATE_CMA, because you'll end up "consuming" all memory for unmovable
> allocations in the system), and we shouldn't advocate the use of unlimited
> overcommit for huge pages ...
>
Agree with David(s). Such an option should really be decided by a sysadmin.
Any reason why liburing can not use THP? Seems like that would provide the
desired functionality.
--
Mike Kravetz
prev parent reply other threads:[~2023-06-12 16:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-10 1:21 [PATCH] mm: hugetlb: Add Kconfig option to set default nr_overcommit_hugepages Josh Triplett
2023-06-11 5:20 ` David Rientjes
2023-06-12 9:12 ` David Hildenbrand
2023-06-12 16:42 ` 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=20230612164205.GA3704@monkey \
--to=mike.kravetz@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=david@redhat.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=rientjes@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;
as well as URLs for NNTP newsgroup(s).