public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Red Hat)" <david@kernel.org>
To: Gregory Price <gourry@gourry.net>,
	linux-mm@kvack.org, akpm@linux-foundation.org
Cc: kernel-team@meta.com, vbabka@suse.cz, surenb@google.com,
	mhocko@suse.com, jackmanb@google.com, hannes@cmpxchg.org,
	ziy@nvidia.com, linux-kernel@vger.kernel.org,
	Mel Gorman <mgorman@suse.de>,
	Alexandru Moise <00moses.alexander00@gmail.com>,
	David Rientjes <rientjes@google.com>
Subject: Re: [PATCH v2] mm, hugetlb: implement movable_gigantic_pages sysctl
Date: Tue, 25 Nov 2025 11:24:24 +0100	[thread overview]
Message-ID: <c309a251-5d14-49a9-a3d7-5c60d100c4eb@kernel.org> (raw)
In-Reply-To: <20251121192746.256051-1-gourry@gourry.net>

On 11/21/25 20:27, Gregory Price wrote:
> This reintroduces a concept removed by
> commit d6cb41cc44c6 ("mm, hugetlb: remove hugepages_treat_as_movable sysctl")
> 
> This sysctl provides some flexibility between multiple 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.
> 
> 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@redhat.com>
> Cc: Mel Gorman <mgorman@suse.de>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: Alexandru Moise <00moses.alexander00@gmail.com>
> Suggested-by: David Rientjes <rientjes@google.com>
> Signed-off-by: Gregory Price <gourry@gourry.net>
> Link: https://lore.kernel.org/all/20180201193132.Hk7vI_xaU%25akpm@linux-foundation.org/
> ---
>   Documentation/admin-guide/sysctl/vm.rst | 17 +++++++++++++++++
>   include/linux/hugetlb.h                 |  3 ++-
>   mm/hugetlb.c                            | 11 +++++++++++
>   3 files changed, 30 insertions(+), 1 deletion(-)
> 
> ---
> v2: changelog updates
> 
> 
> diff --git a/Documentation/admin-guide/sysctl/vm.rst b/Documentation/admin-guide/sysctl/vm.rst
> index b325bfbc2611..fe3982604b1f 100644
> --- a/Documentation/admin-guide/sysctl/vm.rst
> +++ b/Documentation/admin-guide/sysctl/vm.rst
> @@ -54,6 +54,7 @@ Currently, these files are in /proc/sys/vm:
>   - mmap_min_addr
>   - mmap_rnd_bits
>   - mmap_rnd_compat_bits
> +- movable_gigantic_pages
>   - nr_hugepages
>   - nr_hugepages_mempolicy
>   - nr_overcommit_hugepages
> @@ -623,6 +624,22 @@ This value can be changed after boot using the
>   /proc/sys/vm/mmap_rnd_compat_bits tunable
>   
>   
> +movable_gigantic_pages
> +======================
> +
> +This parameter controls whether gigantic pages may be allocated from
> +ZONE_MOVABLE. If set to non-zero, gigantic hugepages can be allocated

"gigantic pages" or "gigantic hugetlb pages"

> +from ZONE_MOVABLE. ZONE_MOVABLE memory may be created via the kernel
> +boot parameter `kernelcore` or via memory hotplug as discussed in
> +Documentation/admin-guide/mm/memory-hotplug.rst.
> +
> +Support may depend on specific architecture.
> +
> +Note that using ZONE_MOVABLE gigantic pages may make features like
> +memory hotremove more unreliable, as migrating gigantic pages is more
> +difficult due to needing larger amounts of phyiscally contiguous memory.

s/phyiscally/physically/ ?

Can we also reference this parameter here from 
Documentation/admin-guide/mm/memory-hotplug.rst?

In particular, there we also talk about gigantic pages and the 
interaction with ZONE_MOVABLE:

"
- Gigantic pages are unmovable, resulting in user space consuming a
   lot of unmovable memory.

- Huge pages are unmovable when an architectures does not support huge
   page migration, resulting in a similar issue as with gigantic pages.
"

And then later, we talk about "Even with ZONE_MOVABLE, there are some 
corner cases where offlining a memory
block might fail:" where this should be spelled out as well.

-- 
Cheers

David


  reply	other threads:[~2025-11-25 10:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-21 19:27 [PATCH v2] mm, hugetlb: implement movable_gigantic_pages sysctl Gregory Price
2025-11-25 10:24 ` David Hildenbrand (Red Hat) [this message]
2025-11-25 13:15   ` Gregory Price

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=c309a251-5d14-49a9-a3d7-5c60d100c4eb@kernel.org \
    --to=david@kernel.org \
    --cc=00moses.alexander00@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=gourry@gourry.net \
    --cc=hannes@cmpxchg.org \
    --cc=jackmanb@google.com \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.com \
    --cc=rientjes@google.com \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --cc=ziy@nvidia.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