From: Andrew Morton <akpm@linux-foundation.org>
To: Gregory Price <gourry@gourry.net>
Cc: linux-mm@kvack.org, corbet@lwn.net, muchun.song@linux.dev,
osalvador@suse.de, david@redhat.com, hannes@cmpxchg.org,
laoar.shao@gmail.com, brauner@kernel.org, mclapinski@google.com,
joel.granados@kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, Mel Gorman <mgorman@suse.de>,
Michal Hocko <mhocko@suse.com>,
Alexandru Moise <00moses.alexander00@gmail.com>,
Mike Kravetz <mike.kravetz@oracle.com>,
David Rientjes <rientjes@google.com>
Subject: Re: [PATCH] Revert "mm, hugetlb: remove hugepages_treat_as_movable sysctl"
Date: Tue, 7 Oct 2025 14:59:55 -0700 [thread overview]
Message-ID: <20251007145955.31dba3afad6200e885e906a5@linux-foundation.org> (raw)
In-Reply-To: <20251007214412.3832340-1-gourry@gourry.net>
On Tue, 7 Oct 2025 17:44:12 -0400 Gregory Price <gourry@gourry.net> wrote:
> This reverts commit d6cb41cc44c63492702281b1d329955ca767d399.
It's been seven years. Perhaps "reintroduce hugepages_treat_as_movable
sysctl" would be a better way of presenting this. Not very important.
> This sysctl provides some flexibility between multiple requirements which
> are difficult to square without adding significantly more complexity.
>
> 1) onlining memory in ZONE_MOVABLE to maintain hotplug compatibility
> 2) onlining memory in ZONE_MOVABLE to prevent GFP_KERNEL usage
> 3) passing NUMA structure through to a virtual machine (node0=vnode0,
> node1=vnode1) so a guest can make good placement decisions.
> 4) utilizing 1GB hugepages for VM host memory to reduce TLB pressure
> 5) Managing device memory after init-time to avoid incidental usage
> at boot (due to being placed in ZONE_NORMAL), or to provide users
> configuration flexibility.
>
> When device-hotplugged memory does not require hot-unplug assurances,
> there is no reason to avoid allowing otherwise non-migratable hugepages
> in this zone. This allows for allocation of 1GB gigantic pages for VMs
> with existing mechanisms.
>
> Boot-time CMA is not possible for driver-managed hotplug memory, as CMA
> requires the memory to be registered as SystemRAM at boot time.
>
> Updated the code to land in appropriate locations since it all moved.
> Updated the documentation to add more context when this is useful.
I'll duck the patch for now, see what people have to say.
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -55,6 +55,8 @@
> #include "hugetlb_cma.h"
> #include <linux/page-isolation.h>
>
> +int hugepages_treat_as_movable;
> +
> int hugetlb_max_hstate __read_mostly;
> unsigned int default_hstate_idx;
> struct hstate hstates[HUGE_MAX_HSTATE];
Could sprinkle some more __read_mostlys around here?
>
> ...
>
next prev parent reply other threads:[~2025-10-07 22:00 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-07 21:44 Gregory Price
2025-10-07 21:59 ` Andrew Morton [this message]
2025-10-07 22:12 ` Gregory Price
2025-10-08 8:58 ` David Hildenbrand
2025-10-08 14:18 ` Gregory Price
2025-10-08 14:44 ` David Hildenbrand
2025-10-08 18:58 ` Gregory Price
2025-10-08 19:01 ` David Hildenbrand
2025-10-08 19:44 ` Gregory Price
2025-10-08 19:52 ` David Hildenbrand
2025-10-08 19:59 ` Gregory Price
2025-10-08 14:59 ` Michal Hocko
2025-10-08 15:14 ` David Hildenbrand
2025-10-08 15:23 ` Michal Hocko
2025-10-08 15:43 ` David Hildenbrand
2025-10-08 16:31 ` Gregory Price
2025-10-09 6:14 ` Michal Hocko
2025-10-09 15:29 ` Gregory Price
2025-10-09 18:47 ` Michal Hocko
2025-10-09 18:51 ` David Hildenbrand
2025-10-09 21:31 ` Gregory Price
2025-10-10 7:40 ` David Hildenbrand
2025-10-10 18:53 ` Gregory Price
2025-10-08 16:08 ` Frank van der Linden
2025-10-08 16:39 ` Gregory Price
2025-10-08 17:05 ` 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=20251007145955.31dba3afad6200e885e906a5@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=00moses.alexander00@gmail.com \
--cc=brauner@kernel.org \
--cc=corbet@lwn.net \
--cc=david@redhat.com \
--cc=gourry@gourry.net \
--cc=hannes@cmpxchg.org \
--cc=joel.granados@kernel.org \
--cc=laoar.shao@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mclapinski@google.com \
--cc=mgorman@suse.de \
--cc=mhocko@suse.com \
--cc=mike.kravetz@oracle.com \
--cc=muchun.song@linux.dev \
--cc=osalvador@suse.de \
--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