public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] btrfs: reduce btrfs_get_extent() calls for buffered write path
@ 2025-11-20  0:04 Qu Wenruo
  2025-11-20  0:04 ` [PATCH 1/4] btrfs: integrate the error handling of submit_one_sector() Qu Wenruo
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Qu Wenruo @ 2025-11-20  0:04 UTC (permalink / raw)
  To: linux-btrfs

Although btrfs has bs < ps support for a long time, and the larger data
folios support is also going to be graduate from experimental features
soon, the write path is still iterating each fs block and call
btrfs_get_extent() on each fs block.

What makes the situation worse is that, for the write path we do not
have any cached extent map, meaning even with large folios and we got a
continuous range that can be submitted in one go, we still call
btrfs_get_extent() many times and get the same range extent map again
and again.

This series will reduce the duplicated btrfs_get_extent() calls by only
call it once for each range, other than for each fs block.

The first 3 patches are just minor cleanups/refactors, the last patch
is the real optimization.

I don't expect there will be much difference in the real world though.

Qu Wenruo (4):
  btrfs: integrate the error handling of submit_one_sector()
  btrfs: use bitmap_set() to replace set_bit() in a loop
  btrfs: extract the io finishing code into a helper
  btrfs: reduce extent map lookup during writes

 fs/btrfs/extent_io.c | 243 ++++++++++++++++++++++++-------------------
 1 file changed, 134 insertions(+), 109 deletions(-)

-- 
2.52.0


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

end of thread, other threads:[~2025-11-20  9:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-20  0:04 [PATCH 0/4] btrfs: reduce btrfs_get_extent() calls for buffered write path Qu Wenruo
2025-11-20  0:04 ` [PATCH 1/4] btrfs: integrate the error handling of submit_one_sector() Qu Wenruo
2025-11-20  0:04 ` [PATCH 2/4] btrfs: use bitmap_set() to replace set_bit() in a loop Qu Wenruo
2025-11-20  0:04 ` [PATCH 3/4] btrfs: extract the io finishing code into a helper Qu Wenruo
2025-11-20  0:59   ` Boris Burkov
2025-11-20  1:11     ` Qu Wenruo
2025-11-20  0:04 ` [PATCH 4/4] btrfs: reduce extent map lookup during writes Qu Wenruo
2025-11-20  1:16   ` Boris Burkov
2025-11-20  5:28     ` Qu Wenruo
2025-11-20  9:00       ` Qu Wenruo

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