[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251007145955.31dba3afad6200e885e906a5@linux-foundation.org>
Date: Tue, 7 Oct 2025 14:59:55 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Gregory Price <gourry@...rry.net>
Cc: linux-mm@...ck.org, corbet@....net, muchun.song@...ux.dev,
osalvador@...e.de, david@...hat.com, hannes@...xchg.org,
laoar.shao@...il.com, brauner@...nel.org, mclapinski@...gle.com,
joel.granados@...nel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, Mel Gorman <mgorman@...e.de>, Michal Hocko
<mhocko@...e.com>, Alexandru Moise <00moses.alexander00@...il.com>, Mike
Kravetz <mike.kravetz@...cle.com>, David Rientjes <rientjes@...gle.com>
Subject: Re: [PATCH] Revert
"mm, hugetlb: remove hugepages_treat_as_movable sysctl"
On Tue, 7 Oct 2025 17:44:12 -0400 Gregory Price <gourry@...rry.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?
>
> ...
>
Powered by blists - more mailing lists