From: Vlastimil Babka <vbabka@suse.cz>
To: Juan Yescas <jyescas@google.com>, David Hildenbrand <david@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>, Zi Yan <ziy@nvidia.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
tjmercier@google.com, isaacmanjarres@google.com,
kaleshsingh@google.com, masahiroy@kernel.org,
Minchan Kim <minchan@kernel.org>
Subject: Re: [PATCH v6] mm: Add CONFIG_PAGE_BLOCK_ORDER to select page block order
Date: Wed, 28 May 2025 09:31:11 +0200 [thread overview]
Message-ID: <f5f5b4c6-90b1-4736-acfe-e4a6dbf4bb3f@suse.cz> (raw)
In-Reply-To: <CAJDx_rjyLXxFxCG3QENN23+Xcao=_jeLTDZho0xrLm5i=Sc9GQ@mail.gmail.com>
On 5/21/25 18:51, Juan Yescas wrote:
> On Tue, May 20, 2025 at 11:47 PM David Hildenbrand <david@redhat.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
>>
prev parent reply other threads:[~2025-05-28 7:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-20 22:59 Juan Yescas
2025-05-21 6:47 ` David Hildenbrand
2025-05-21 16:51 ` Juan Yescas
2025-05-28 7:31 ` Vlastimil Babka [this message]
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=f5f5b4c6-90b1-4736-acfe-e4a6dbf4bb3f@suse.cz \
--to=vbabka@suse.cz \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=isaacmanjarres@google.com \
--cc=jyescas@google.com \
--cc=kaleshsingh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=masahiroy@kernel.org \
--cc=mhocko@suse.com \
--cc=minchan@kernel.org \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=tjmercier@google.com \
--cc=ziy@nvidia.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