linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [LSF/MM/BPF TOPIC] Migrating the un-migratable
@ 2025-01-29 16:10 David Hildenbrand
  2025-01-30 19:39 ` Frank van der Linden
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: David Hildenbrand @ 2025-01-29 16:10 UTC (permalink / raw)
  To: lsf-pc
  Cc: linux-fsdevel, linux-mm, Jeff Layton, Zi Yan, Shakeel Butt,
	Joanne Koong, Miklos Szeredi

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-03-24 18:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-29 16:10 [LSF/MM/BPF TOPIC] Migrating the un-migratable David Hildenbrand
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox