lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <09689e62-a8bd-4822-84ba-0f72f94fed52@gmail.com>
Date: Tue, 7 Oct 2025 23:52:46 +0100
From: Usama Arif <usamaarif642@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: muchun.song@...ux.dev, osalvador@...e.de, david@...hat.com,
 linux-mm@...ck.org, hannes@...xchg.org, riel@...riel.com, kas@...nel.org,
 linux-kernel@...r.kernel.org, kernel-team@...a.com,
 Shakeel Butt <shakeel.butt@...ux.dev>
Subject: Re: [PATCH] mm/hugetlb: allow overcommitting gigantic hugepages



On 07/10/2025 23:24, Andrew Morton wrote:
> On Mon,  6 Oct 2025 19:56:07 +0100 Usama Arif <usamaarif642@...il.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ