From: David Hildenbrand <david@redhat.com>
To: "lsf-pc@lists.linux-foundation.org" <lsf-pc@lists.linux-foundation.org>
Cc: linux-fsdevel@vger.kernel.org,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Jeff Layton <jlayton@kernel.org>, Zi Yan <ziy@nvidia.com>,
Shakeel Butt <shakeel.butt@linux.dev>,
Joanne Koong <joannelkoong@gmail.com>,
Miklos Szeredi <miklos@szeredi.hu>
Subject: [LSF/MM/BPF TOPIC] Migrating the un-migratable
Date: Wed, 29 Jan 2025 17:10:03 +0100 [thread overview]
Message-ID: <882b566c-34d6-4e68-9447-6c74a0693f18@redhat.com> (raw)
Hi,
___GFP_MOVABLE allocations are supposed to be movable -> migratable: the
page allocator can place them on
MIGRATE_CMA/ZONE_MOVABLE/MIGRATE_MOVABLE areas: areas where the
expectation is that allocations can be migrated (somewhat reliably) to
different memory areas on demand.
Mechanisms that turn such allocations unmigratable, such as long-term
page pinning (FOLL_LONGTERM), migrate these allocations at least out of
MIGRATE_CMA/ZONE_MOVABLE areas first.
Ideally, we'd only perform this migration if really required (e.g.,
long-term pinning), and rather "fix" other cases to not turn allocations
unmigratable.
However, we have some rather obscure cases that can turn migratable
allocations effectively unmigratable for a long/indeterminate time,
possibly controlled by unprivileged user space.
Possible effects include:
* CMA allocations failing
* Memory hotunplug not making progress
* Memory compaction not working as expected
Some cases I can fix myself [1], others are harder to tackle.
As one example, in context of FUSE we recently discovered that folios
that are under writeback cannot be migrated, and user space in control
of when writeback will end. Something similar can happen ->readahead()
where user space is in charge of supplying page content. Networking
filesystems in general seem to be prone to this as well.
As another example, failing to split large folios can prevent migration
if memory is fragmented. XFS (IOMAP in general) refuses to split folios
that are dirty [3]. Splitting of folios and page migration have a lot in
common.
This session is to collect cases that are known to be problematic, and
to start discussing possible approaches to make some of these
un-migratable allocations migratable, or alternative strategies to deal
with this.
[1] https://lkml.kernel.org/r/20250129115411.2077152-1-david@redhat.com
[2]
https://lkml.kernel.org/r/CAJnrk1ZCgff6ZWmqKzBXFq5uAEbms46OexA1axWS5v-PCZFqJg@mail.gmail.com
[3]
https://lkml.kernel.org/r/4febc035-a4ff-4afe-a9a0-d127826852a9@redhat.com
--
Cheers,
David / dhildenb
next reply other threads:[~2025-01-29 16:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-29 16:10 David Hildenbrand [this message]
2025-01-30 19:39 ` Frank van der Linden
2025-01-31 9:21 ` Shakeel Butt
2025-01-30 21:48 ` Matthew Wilcox
2025-01-30 22:33 ` Shakeel Butt
2025-01-30 22:52 ` David Hildenbrand
2025-03-24 18:55 ` 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=882b566c-34d6-4e68-9447-6c74a0693f18@redhat.com \
--to=david@redhat.com \
--cc=jlayton@kernel.org \
--cc=joannelkoong@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lsf-pc@lists.linux-foundation.org \
--cc=miklos@szeredi.hu \
--cc=shakeel.butt@linux.dev \
--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