[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <305328e0-3011-409c-a040-76fc478d541a@kernel.org>
Date: Wed, 3 Dec 2025 10:26:20 +0100
From: "David Hildenbrand (Red Hat)" <david@...nel.org>
To: Gregory Price <gourry@...rry.net>, linux-mm@...ck.org
Cc: kernel-team@...a.com, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, osalvador@...e.de, akpm@...ux-foundation.org,
lorenzo.stoakes@...cle.com, Liam.Howlett@...cle.com, vbabka@...e.cz,
rppt@...nel.org, surenb@...gle.com, mhocko@...e.com, corbet@....net,
muchun.song@...ux.dev, Mel Gorman <mgorman@...e.de>,
Alexandru Moise <00moses.alexander00@...il.com>,
David Rientjes <rientjes@...gle.com>
Subject: Re: [PATCH v3] mm, hugetlb: implement movable_gigantic_pages sysctl
On 12/3/25 07:38, Gregory Price wrote:
> This reintroduces a concept removed by:
> commit d6cb41cc44c6 ("mm, hugetlb: remove hugepages_treat_as_movable sysctl")
>
> This sysctl provides flexibility between ZONE_MOVABLE use cases:
> 1) onlining memory in ZONE_MOVABLE to maintain hotplug compatibility
> 2) onlining memory in ZONE_MOVABLE to make hugepage allocate reliable
>
> When ZONE_MOVABLE is used to make huge page allocation more reliable,
> disallowing gigantic pages memory in this region is pointless. If
> hotplug is not a requirement, we can loosen the restrictions to allow
> 1GB gigantic pages in ZONE_MOVABLE.
>
> Since 1GB can be difficult to migrate / has impacts on compaction /
> defragmentation, we don't enable this by default. Notably, 1GB pages
> can only be migrated if another 1GB page is available - so hot-unplug
> will fail if such a page cannot be found.
In light of the other discussion: will it fail or will it simplt retry
forever, until there is a free 1g page?
>
> However, since there are scenarios where gigantic pages are migratable,
> we should allow use of these on movable regions.
>
> Note: Boot-time CMA is not possible for driver-managed hotplug memory,
> as CMA requires the memory to be registered as SystemRAM at boot time.
> Additionally, 1GB huge pages are not supported by THP.
>
> Cc: David Hildenbrand <david@...hat.com>
> Cc: Mel Gorman <mgorman@...e.de>
> Cc: Michal Hocko <mhocko@...e.com>
> Cc: Alexandru Moise <00moses.alexander00@...il.com>
> Suggested-by: David Rientjes <rientjes@...gle.com>
> Signed-off-by: Gregory Price <gourry@...rry.net>
> Link: https://lore.kernel.org/all/20180201193132.Hk7vI_xaU%25akpm@linux-foundation.org/
> ---
> Documentation/admin-guide/mm/memory-hotplug.rst | 14 ++++++++++++--
> Documentation/admin-guide/sysctl/vm.rst | 17 +++++++++++++++++
> include/linux/hugetlb.h | 3 ++-
> mm/hugetlb.c | 1 -
> mm/hugetlb_sysctl.c | 9 +++++++++
> 5 files changed, 40 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/admin-guide/mm/memory-hotplug.rst b/Documentation/admin-guide/mm/memory-hotplug.rst
> index 33c886f3d198..6581558fd0d7 100644
> --- a/Documentation/admin-guide/mm/memory-hotplug.rst
> +++ b/Documentation/admin-guide/mm/memory-hotplug.rst
> @@ -612,8 +612,9 @@ ZONE_MOVABLE, especially when fine-tuning zone ratios:
> allocations and silently create a zone imbalance, usually triggered by
> inflation requests from the hypervisor.
>
> -- Gigantic pages are unmovable, resulting in user space consuming a
> - lot of unmovable memory.
> +- Gigantic pages are unmovable when an architecture does not support
> + huge page migration and/or the ``movable_gigantic_pages`` sysctl is false.
> + See Documentation/admin-guide/sysctl/vm.rst for more info on this sysctl.
>
> - Huge pages are unmovable when an architectures does not support huge
> page migration, resulting in a similar issue as with gigantic pages.
> @@ -672,6 +673,15 @@ block might fail:
> - Concurrent activity that operates on the same physical memory area, such as
> allocating gigantic pages, can result in temporary offlining failures.
>
> +- When an admin sets the ``movable_gigantic_pages`` sysctl to true, gigantic
> + pages are allowed in ZONE_MOVABLE. This only allows migratable gigantic
> + pages to be allocated; however, if there are no eligible destination gigantic
> + pages at offline, the offlining operation will fail.
Same question here.
Nothing else jumped at me, in general as discussed, as long as it is
opt-in behavior
Acked-by: David Hildenbrand (Red Hat) <david@...nel.org>
--
Cheers
David
Powered by blists - more mailing lists