linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] fs/buffer: split pagecache lookups into atomic or blocking
@ 2025-04-18  1:59 Davidlohr Bueso
  2025-04-18  1:59 ` [PATCH 1/7] fs/buffer: split locking for pagecache lookups Davidlohr Bueso
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Davidlohr Bueso @ 2025-04-18  1:59 UTC (permalink / raw)
  To: jack, tytso, adilger.kernel, brauner
  Cc: mcgrof, willy, hare, djwong, linux-ext4, linux-fsdevel, linux-mm,
	Davidlohr Bueso

Hello,

Changes from v1: rebased on top of vfs.fixes (Christian).

This is a respin of the series[0] to address the sleep in atomic scenarios for
noref migration with large folios, introduced in:

      3c20917120ce61 ("block/bdev: enable large folio support for large logical block sizes")

The main difference is that it removes the first patch and moves the fix (reducing
the i_private_lock critical region in the migration path) to the final patch, which
also introduces the new BH_Migrate flag. It also simplifies the locking scheme in
patch 1 to avoid folio trylocking in the atomic lookup cases. So essentially blocking
users will take the folio lock and hence wait for migration, and otherwise nonblocking
callers will bail the lookup if a noref migration is on-going. Blocking callers
will also benefit from potential performance gains by reducing contention on the
spinlock for bdev mappings.

Applies against latest vfs.fixes. Please consider for Linus' tree.

Patch 1: carves a path for callers that can block to take the folio lock.
Patch 2: adds sleeping flavors to pagecache lookups, no users.
Patches 3-6: converts to the new call, where possible.
Patch 7: does the actual sleep in atomic fix.

Thanks!

[0] https://lore.kernel.org/all/20250410014945.2140781-1-mcgrof@kernel.org/

Davidlohr Bueso (7):
  fs/buffer: split locking for pagecache lookups
  fs/buffer: introduce sleeping flavors for pagecache lookups
  fs/buffer: use sleeping version of __find_get_block()
  fs/ocfs2: use sleeping version of __find_get_block()
  fs/jbd2: use sleeping version of __find_get_block()
  fs/ext4: use sleeping version of sb_find_get_block()
  mm/migrate: fix sleep in atomic for large folios and buffer heads

 fs/buffer.c                 | 73 +++++++++++++++++++++++++++----------
 fs/ext4/ialloc.c            |  3 +-
 fs/ext4/mballoc.c           |  3 +-
 fs/jbd2/revoke.c            | 15 +++++---
 fs/ocfs2/journal.c          |  2 +-
 include/linux/buffer_head.h |  9 +++++
 mm/migrate.c                |  8 ++--
 7 files changed, 82 insertions(+), 31 deletions(-)

--
2.39.5



^ permalink raw reply	[flat|nested] 12+ messages in thread
* [PATCH -next 0/7] fs/buffer: split pagecache lookups into atomic or blocking
@ 2025-04-15 23:16 Davidlohr Bueso
  2025-04-15 23:16 ` [PATCH 3/7] fs/buffer: use sleeping version of __find_get_block() Davidlohr Bueso
  0 siblings, 1 reply; 12+ messages in thread
From: Davidlohr Bueso @ 2025-04-15 23:16 UTC (permalink / raw)
  To: jack, tytso, adilger.kernel, brauner
  Cc: mcgrof, willy, hare, djwong, linux-ext4, linux-fsdevel, linux-mm,
	Davidlohr Bueso

Hello,

This is a respin of the series[0] to address the sleep in atomic scenarios for
noref migration with large folios, introduced in:

      3c20917120ce61 ("block/bdev: enable large folio support for large logical block sizes")

The main difference is that it removes the first patch and moves the fix (reducing
the i_private_lock critical region in the migration path) to the final patch, which
also introduces the new BH_Migrate flag. It also simplifies the locking scheme in
patch 1 to avoid folio trylocking in the atomic lookup cases. So essentially blocking
users will take the folio lock and hence wait for migration, and otherwise nonblocking
callers will bail the lookup if a noref migration is on-going. Blocking callers
will also benefit from potential performance gains by reducing contention on the
spinlock for bdev mappings.

It is noteworthy that this series is probably too big for Linus' tree, so there are
two options:

 1. Revert 3c20917120ce61, add this series + 3c20917120ce61 for next. Or,
 2. Cherry pick patch 7 as a fix for Linus' tree, and leave the rest for next.
    But that could break lookup callers that have been deemed unfit to bail.

Patch 1: carves a path for callers that can block to take the folio lock.
Patch 2: adds sleeping flavors to pagecache lookups, no users.
Patches 3-6: converts to the new call, where possible.
Patch 7: does the actual sleep in atomic fix.

Thanks!

[0] https://lore.kernel.org/all/20250410014945.2140781-1-mcgrof@kernel.org/

Davidlohr Bueso (7):
  fs/buffer: split locking for pagecache lookups
  fs/buffer: introduce sleeping flavors for pagecache lookups
  fs/buffer: use sleeping version of __find_get_block()
  fs/ocfs2: use sleeping version of __find_get_block()
  fs/jbd2: use sleeping version of __find_get_block()
  fs/ext4: use sleeping version of sb_find_get_block()
  mm/migrate: fix sleep in atomic for large folios and buffer heads

 fs/buffer.c                 | 73 +++++++++++++++++++++++++++----------
 fs/ext4/ialloc.c            |  3 +-
 fs/ext4/mballoc.c           |  3 +-
 fs/jbd2/revoke.c            | 15 +++++---
 fs/ocfs2/journal.c          |  2 +-
 include/linux/buffer_head.h |  9 +++++
 mm/migrate.c                |  8 ++--
 7 files changed, 82 insertions(+), 31 deletions(-)

--
2.39.5



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

end of thread, other threads:[~2025-04-22  7:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-18  1:59 [PATCH v2 0/7] fs/buffer: split pagecache lookups into atomic or blocking Davidlohr Bueso
2025-04-18  1:59 ` [PATCH 1/7] fs/buffer: split locking for pagecache lookups Davidlohr Bueso
2025-04-18  1:59 ` [PATCH 2/7] fs/buffer: introduce sleeping flavors " Davidlohr Bueso
2025-04-18  1:59 ` [PATCH 3/7] fs/buffer: use sleeping version of __find_get_block() Davidlohr Bueso
2025-04-18  1:59 ` [PATCH 4/7] fs/ocfs2: " Davidlohr Bueso
2025-04-18  1:59 ` [PATCH 5/7] fs/jbd2: " Davidlohr Bueso
2025-04-18  1:59 ` [PATCH 6/7] fs/ext4: use sleeping version of sb_find_get_block() Davidlohr Bueso
2025-04-18  1:59 ` [PATCH 7/7] mm/migrate: fix sleep in atomic for large folios and buffer heads Davidlohr Bueso
2025-04-21 21:06 ` [PATCH v2 0/7] fs/buffer: split pagecache lookups into atomic or blocking Luis Chamberlain
2025-04-22  7:51 ` Christian Brauner
  -- strict thread matches above, loose matches on Subject: below --
2025-04-15 23:16 [PATCH -next " Davidlohr Bueso
2025-04-15 23:16 ` [PATCH 3/7] fs/buffer: use sleeping version of __find_get_block() Davidlohr Bueso
2025-04-16  9:33   ` Jan Kara

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