From: Usama Arif <usamaarif642@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: muchun.song@linux.dev, osalvador@suse.de, david@redhat.com,
linux-mm@kvack.org, hannes@cmpxchg.org, riel@surriel.com,
kas@kernel.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com, Shakeel Butt <shakeel.butt@linux.dev>
Subject: Re: [PATCH] mm/hugetlb: allow overcommitting gigantic hugepages
Date: Tue, 7 Oct 2025 23:52:46 +0100 [thread overview]
Message-ID: <09689e62-a8bd-4822-84ba-0f72f94fed52@gmail.com> (raw)
In-Reply-To: <20251007152429.4c28fb85205635703229b027@linux-foundation.org>
On 07/10/2025 23:24, Andrew Morton wrote:
> On Mon, 6 Oct 2025 19:56:07 +0100 Usama Arif <usamaarif642@gmail.com> wrote:
>
>> Currently, gigantic hugepages cannot use the overcommit mechanism
>> (nr_overcommit_hugepages), forcing users to permanently reserve memory via
>> nr_hugepages even when pages might not be actively used.
>>
>
> Why did we do that? Just an oversight?
I believe this restriction was added in 2011 [1], which was before there was support for reserving
1G hugepages at runtime. Once that was added, I think we forgot to remove this restriction.
[1] https://git.zx2c4.com/linux-rng/commit/mm/hugetlb.c?id=adbe8726dc2a3805630d517270db17e3af86e526
>
>> - if (hstate_is_gigantic(h))
>> + if (hstate_is_gigantic(h) && !gigantic_page_runtime_supported())
>
>> - if (hstate_is_gigantic(h))
>> + if (hstate_is_gigantic(h) && !gigantic_page_runtime_supported())
>
>> - if (write && hstate_is_gigantic(h))
>> + if (write && hstate_is_gigantic(h) && !gigantic_page_runtime_supported())
>
> Maybe a little helper for this?
>
> (Little helpers are nice sites for code comments!)
Will add this in the next revision, Along with a paragraph about the history
of why this restriction existed in the first place.
Thanks for the review!
Usama
next prev parent reply other threads:[~2025-10-07 22:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-06 18:56 Usama Arif
2025-10-07 22:24 ` Andrew Morton
2025-10-07 22:52 ` Usama Arif [this message]
2025-10-08 9:02 ` David Hildenbrand
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=09689e62-a8bd-4822-84ba-0f72f94fed52@gmail.com \
--to=usamaarif642@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=kas@kernel.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=osalvador@suse.de \
--cc=riel@surriel.com \
--cc=shakeel.butt@linux.dev \
/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