From: David Hildenbrand <david@redhat.com>
To: Gregory Price <gourry@gourry.net>, Michal Hocko <mhocko@suse.com>
Cc: linux-mm@kvack.org, corbet@lwn.net, muchun.song@linux.dev,
osalvador@suse.de, akpm@linux-foundation.org, 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>,
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: Thu, 9 Oct 2025 20:51:54 +0200 [thread overview]
Message-ID: <ac0393c7-9c0c-4b4d-8b35-5e6369e5431b@redhat.com> (raw)
In-Reply-To: <aOfU9YTKMPWzYOta@gourry-fedora-PF4VCD3F>
On 09.10.25 17:29, Gregory Price wrote:
> On Thu, Oct 09, 2025 at 08:14:22AM +0200, Michal Hocko wrote:
>> On Wed 08-10-25 12:31:22, Gregory Price wrote:
>>>> I'm not quite clear yet on the use case, though. If all the user allocations
>>>> end up fragmenting the memory, there is also not a lot of benefit to be had
>>>> from that zone long term.
>>>>
>>>
>>> The only real use case i've seen is exactly:
>>> - Don't want random GFP_KERNEL to land there
>>> - Might want it to be pinnable
>>>
>>> I think that covers what you've described above.
>>>
>>> But adding an entire zone felt a bit heavy handed. Allowing gigantic in
>>> movable seemed less - immediately - offensive.
>>
>> The question is whether we need a full zone for that or we can control
>> those allocation constrains on per memory block bases to override
>> otherwise default. So it wouldn't be MOVABLE but rather something like
>> USER zone.
>
>
> Mild ignorance here - but I don't think the buddy allocator currently
> differentiates chunks of memory based on block membership, it just eats
> folios from certain zones/nodes.
>
> I'm scratching my head trying to think of the discrete mechanism to do
> this that doesn't inject significantly more complexity into the buddy
> allocator.
>
> Looking at the recent[1] THP support for ZONE_DEVICE, I wonder if we end
> up with something more along these lines? But this aschews the other
> requirement of wanting the memory to be otherwise general purpose.
>
> https://lore.kernel.org/linux-mm/20251001065707.920170-1-balbirs@nvidia.com/
>
> ZONE_USER does feel like the most natural solution. Literally just
> (ZONE_NORMAL - GFP_KERNEL). This might need a new GFP flag for certain
> use cases like KVM (GFP_USER) to denote certain "This isn't technically
> kernel memory, but it needs to be pinnable". That would slot right
> between ZONE_NORMAL and ZONE_MOVABLE.
>
> Alternatively we could go the opposite way and introduce ZONE_KERNEL
> below ZONE_NORMAL and disallow GFP_KERNEL from ZONE_NORMAL - then have
> strict watermarks on ZONE_KERNEL to ensure the kernel is always able
> to get memory.
I'm afraid any new zone will be highly controversial and take a long
time to get accepted, if ever :)
The real question is: would we really need a system where we mix e.g.,
ZONE_USER with ZONE_MOVABLE?
Or would it be sufficient to selectively enable (explicit opt-in) some
user pages to end up on ZONE_MOVABLE? IOW, change the semantics of the
zone by an admin.
Like, allowing longterm pinning on ZONE_MOVABLE.
Sure, it would degrade memory hotunplug (until the relevant applications
are shut down) and probably some other things.
Further, I am not so sure about the value of having ZONE_MOVABLE
sprinkled with small unmovable allocations (same concern regarding any
such zone that allows for unmovable things). Kind of against the whole
concept.
But I mean, if the admin decides to do that (opt in), so he is to blame.
--
Cheers
David / dhildenb
next prev parent reply other threads:[~2025-10-09 18:52 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
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 [this message]
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=ac0393c7-9c0c-4b4d-8b35-5e6369e5431b@redhat.com \
--to=david@redhat.com \
--cc=00moses.alexander00@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=corbet@lwn.net \
--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
all inboxes | Powered by JetHome®