From: Gregory Price <gourry@gourry.net>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: Zi Yan <ziy@nvidia.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com, akpm@linux-foundation.org, vbabka@suse.cz,
surenb@google.com, mhocko@suse.com, jackmanb@google.com,
hannes@cmpxchg.org, David Hildenbrand <david@redhat.com>
Subject: Re: [RFC PATCH v2] page_alloc: allow migration of smaller hugepages during contig_alloc
Date: Tue, 21 Oct 2025 12:03:39 -0400 [thread overview]
Message-ID: <aPeu29qbxdn7dmjD@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <20251021091443.5ggfmvl5jwyknjnv@master>
On Tue, Oct 21, 2025 at 09:14:43AM +0000, Wei Yang wrote:
>
> The above code is expanded to:
>
> page = _compound_head(page);
> order = compound_order(page);
> folio = page;
> test_bit(PG_head, &folio->flags.f);
> return folio_large_order(folio);
>
> If we use
>
> order = folio_order(page_folio(page))
>
> It is expanded to:
>
> folio = _compound_head(page);
> folio_test_large(folio)
> folio_test_head(folio)
> test_bit(PG_head, &folio->flags.f)
> return folio_large_order(folio);
>
> These two seems expanded to the same code.
>
folio_test_large drops into const_folio_flags which does
a VM_BUG_ON_PGFLAGS, so not the same logic here.
> Maybe we can use folio_order() here?
>
next prev parent reply other threads:[~2025-10-21 16:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-20 21:08 [RFC PATCH v2] page_alloc: allow migration of smaller hugepages during contig_alloc Gregory Price
2025-10-20 23:02 ` Zi Yan
2025-10-21 1:25 ` Wei Yang
2025-10-21 1:28 ` Zi Yan
2025-10-21 9:14 ` Wei Yang
2025-10-21 16:03 ` Gregory Price [this message]
2025-10-21 20:15 ` Wei Yang
2025-10-21 1:29 ` Wei Yang
2025-10-21 9:30 ` David Hildenbrand
2025-10-21 16:05 ` Gregory Price
2025-10-22 1:40 ` SeongJae Park
2025-10-22 14:53 ` 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=aPeu29qbxdn7dmjD@gourry-fedora-PF4VCD3F \
--to=gourry@gourry.net \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=jackmanb@google.com \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=richard.weiyang@gmail.com \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
--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;
as well as URLs for NNTP newsgroup(s).