linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] mm: move migration work around to buffer-heads
@ 2025-03-30  6:47 Luis Chamberlain
  2025-03-30  6:47 ` [PATCH 1/3] mm/migrate: add might_sleep() on __migrate_folio() Luis Chamberlain
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Luis Chamberlain @ 2025-03-30  6:47 UTC (permalink / raw)
  To: brauner, jack, tytso, adilger.kernel, linux-ext4, riel
  Cc: willy, hannes, oliver.sang, dave, david, axboe, hare, david,
	djwong, ritesh.list, linux-fsdevel, linux-block, linux-mm,
	gost.dev, p.raghav, da.gomez, mcgrof

We have an eye-sore of a spin lock held during page migration which
was added for a ext4 jbd corruption fix for which we have no clear
public corruption data. We want to remove the spin lock on mm/migrate
so to help buffer-head filesystems embrace large folios, since we
can cond_resched() on large folios on folio_mc_copy(). I've managed
to reproduce a corruption by just removing the spinlock and stressing
ext4 with generic/750, a corruption happens after 3 hours.

The spin lock was added to help ext4 jbd and other users of
buffer_migrate_folio_norefs(), so the block device cache and nilfs2.
This does the work to move the heuristic needed to avoid page migration
to back to the buffere-head code on __find_get_block_slow() and only
to users of buffer_migrate_folio_norefs(). I have ran generic/750 over
20 hours and don't see the corruption issue.

I've also ran this patchset against all the following ext4 profiles on
all fstests tests and have found no regression, I've published the
baseline based on linux-next tag next-20250328 onto kdevops [0]. For
further sanity I've also tested this patchset against blktests as well
and found no regressions.

ext4-defaults
ext4-1k
ext4-2k
ext4-4k
ext4-bigalloc16k-4k
ext4-bigalloc32k-4k
ext4-bigalloc64k-4k
ext4-bigalloc1024k-4k
ext4-bigalloc2048k-4k
ext4-advanced-features

[0] https://github.com/linux-kdevops/kdevops/commit/3ecd638e67b14162b76b733a120e6e1b55698cc9

Luis Chamberlain (3):
  mm/migrate: add might_sleep() on __migrate_folio()
  fs/buffer: avoid races with folio migrations on
    __find_get_block_slow()
  mm/migrate: avoid atomic context on buffer_migrate_folio_norefs()
    migration

 fs/buffer.c  | 9 +++++++++
 mm/migrate.c | 6 +++---
 2 files changed, 12 insertions(+), 3 deletions(-)

-- 
2.47.2



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

end of thread, other threads:[~2025-04-04 15:55 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-30  6:47 [PATCH 0/3] mm: move migration work around to buffer-heads Luis Chamberlain
2025-03-30  6:47 ` [PATCH 1/3] mm/migrate: add might_sleep() on __migrate_folio() Luis Chamberlain
2025-03-30 12:04   ` Matthew Wilcox
2025-03-31  6:28     ` Luis Chamberlain
2025-04-01 22:53     ` Davidlohr Bueso
2025-03-30  6:47 ` [PATCH 2/3] fs/buffer: avoid races with folio migrations on __find_get_block_slow() Luis Chamberlain
2025-03-31 19:58   ` Luis Chamberlain
2025-04-02 23:11     ` Luis Chamberlain
2025-04-04 15:55       ` Luis Chamberlain
2025-04-01 10:57   ` Jan Kara
2025-04-01 21:49     ` Davidlohr Bueso
2025-04-02  1:58       ` Matthew Wilcox
2025-04-03  2:04         ` Luis Chamberlain
2025-04-03 13:43           ` Jan Kara
2025-04-03 16:11             ` Theodore Ts'o
2025-04-03  1:02     ` Luis Chamberlain
2025-03-30  6:47 ` [PATCH 3/3] mm/migrate: avoid atomic context on buffer_migrate_folio_norefs() migration Luis Chamberlain

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).