[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f5f5b4c6-90b1-4736-acfe-e4a6dbf4bb3f@suse.cz>
Date: Wed, 28 May 2025 09:31:11 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Juan Yescas <jyescas@...gle.com>, David Hildenbrand <david@...hat.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>, Mike Rapoport
<rppt@...nel.org>, Suren Baghdasaryan <surenb@...gle.com>,
Michal Hocko <mhocko@...e.com>, Zi Yan <ziy@...dia.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, tjmercier@...gle.com,
isaacmanjarres@...gle.com, kaleshsingh@...gle.com, masahiroy@...nel.org,
Minchan Kim <minchan@...nel.org>
Subject: Re: [PATCH v6] mm: Add CONFIG_PAGE_BLOCK_ORDER to select page block
order
On 5/21/25 18:51, Juan Yescas wrote:
> On Tue, May 20, 2025 at 11:47 PM David Hildenbrand <david@...hat.com> wrote:
>> > -#define pageblock_order MIN_T(unsigned int, HUGETLB_PAGE_ORDER, MAX_PAGE_ORDER)
>> > +#define pageblock_order MIN_T(unsigned int, HUGETLB_PAGE_ORDER, PAGE_BLOCK_ORDER)
>> >
>> > #endif /* CONFIG_HUGETLB_PAGE_SIZE_VARIABLE */
>> >
>> > #elif defined(CONFIG_TRANSPARENT_HUGEPAGE)
>> >
>> > -#define pageblock_order MIN_T(unsigned int, HPAGE_PMD_ORDER, MAX_PAGE_ORDER)
>> > +#define pageblock_order MIN_T(unsigned int, HPAGE_PMD_ORDER, PAGE_BLOCK_ORDER)
>>
>> Wait, why are we using the MIN_T in that case? If someone requests 4 MiB, why would we reduce
>> it to 2 MiB even though MAX_PAGE_ORDER allows for it?
>>
> I don't have the context for that change. I think Vlastimil might know
> why it is needed:
>
> That change was introduced in this patch:
> https://lore.kernel.org/all/20240426040258.AD47FC113CD@smtp.kernel.org/
Well the intention was always that pageblock order should be lowered to pmd
order when THPs are enabled as then compaction/anti-fragmentation can better
help them being successfully allocated. And when it turned out this was not
true without having also CONFIG_HUGETLB_PAGE enabled, I considered it a bug.
At the time there was not a proposal to make the pageblock order fully
configurable, so it was just about having the best possible heuristic. Now
we could let the new config override that, but since the main intention here
is to make pageblock order smaller and not larger, it doesn't seem that urgent.
But if we go that way we should make sure the defaults (user doesn't
override MAX_PAGE_ORDER) still result in pageblock_order match PMD_ORDER
with hugepages/THPs enabled, and not become accidentally larger.
> Thanks
> Juan
>
>>
>> Maybe we really have to clean all that up first :/
>>
>> --
>> Cheers,
>>
>> David / dhildenb
>>
Powered by blists - more mailing lists