From: Gregory Price <gourry@gourry.net>
To: David Hildenbrand <david@redhat.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
Subject: Re: [RFC PATCH] page_alloc: allow migration of smaller hugepages during contig_alloc.
Date: Mon, 20 Oct 2025 15:40:37 -0400 [thread overview]
Message-ID: <aPaQNYsN_YPDOwQG@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <272c425a-b191-4eef-af6e-2bca1db7a940@redhat.com>
On Mon, Oct 20, 2025 at 09:18:36PM +0200, David Hildenbrand wrote:
> >
> > Basically, what is the right way of checking a folio order without lock?
> > Should we have a standardized helper function for that?
>
> As raised, snapshot_page() tries to stabilize the folio best it can.
is snapshot_page() even worth it if we're already racing on flag checks?
i.e. there's already a race condition between
pfn_range_valid_contig(range) -> compaction(range)
on some bogus value the worst that happens is either compaction gets
called when it can't compact, or compaction doesn't get called when it
could compact - either way, compaction still handles it if called.
We may just skip some blocks (which is still better than now).
--
on compound_order - from mm.h:
/*
* compound_order() can be called without holding a reference, which means
* that niceties like page_folio() don't work. These callers should be
* prepared to handle wild return values. For example, PG_head may be
* set before the order is initialised, or this may be a tail page.
* See compaction.c for some good examples.
*/
Seems like the correct interface given the scenario. I'll poke around.
~Gregory
next prev parent reply other threads:[~2025-10-20 19:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-20 17:06 Gregory Price
2025-10-20 17:24 ` David Hildenbrand
2025-10-20 17:41 ` Gregory Price
2025-10-20 19:15 ` Zi Yan
2025-10-20 19:18 ` David Hildenbrand
2025-10-20 19:40 ` Gregory Price [this message]
2025-10-20 19:46 ` David Hildenbrand
2025-10-20 19:58 ` Gregory Price
2025-10-20 20:17 ` David Hildenbrand
2025-10-20 20:27 ` Gregory Price
2025-10-20 20:38 ` David Hildenbrand
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=aPaQNYsN_YPDOwQG@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=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