[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <271f9af4-695c-4aa5-9249-2d21ad3db76e@redhat.com>
Date: Wed, 8 Oct 2025 17:14:26 +0200
From: David Hildenbrand <david@...hat.com>
To: Michal Hocko <mhocko@...e.com>
Cc: Gregory Price <gourry@...rry.net>, linux-mm@...ck.org, corbet@....net,
muchun.song@...ux.dev, osalvador@...e.de, akpm@...ux-foundation.org,
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>,
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 08.10.25 16:59, Michal Hocko wrote:
> On Wed 08-10-25 10:58:23, David Hildenbrand wrote:
>> On 07.10.25 23:44, Gregory Price wrote:
> [...]
>>> @@ -926,7 +927,8 @@ static inline gfp_t htlb_alloc_mask(struct hstate *h)
>>> {
>>> gfp_t gfp = __GFP_COMP | __GFP_NOWARN;
>>> - gfp |= hugepage_movable_supported(h) ? GFP_HIGHUSER_MOVABLE : GFP_HIGHUSER;
>>> + gfp |= (hugepage_movable_supported(h) || hugepages_treat_as_movable) ?
>>> + GFP_HIGHUSER_MOVABLE : GFP_HIGHUSER;
>>
>> I mean, this is as ugly as it gets.
>>
>> Can't we just let that old approach RIP where it belongs? :)
>>
>> If something unmovable, it does not belong on ZONE_MOVABLE, as simple as that.
>
> yes, I do agree. This is just muddying the semantic of the zone.
>
> Maybe what we really want is to have a configurable zone rather than a
> very specific consumer of it instead. What do I mean by that? We clearly
> have physically (DMA, DMA32) and usability (NORMAL, MOVABLE) constrained
> zones. So rather than having a MOVABLE zone we can have a single zone
> $FOO_NAME zone with configurable attributes - like allocation
> constrains (kernel, user, movable, etc). Now that we can overlap zones
> this should allow for quite a lot flexibility. Implementation wise this
> would require some tricks as we have 2 zone types for potentially 3
> different major usecases (kernel allocations, userspace reserved ranges
> without movability and movable allocations). I haven't thought this
> through completely and mostly throwing this as an idea (maybe won't
> work). Does that make sense?
I suggested something called PREFER_MOVABLE in the past, that would
prefer movable allocations but nothing would stop unmovable allocations
to end up on it. But only as a last resort or when explicitly requested
(e.g., gigantic pages).
Maybe that's similar to what you have in mind?
--
Cheers
David / dhildenb
Powered by blists - more mailing lists