Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs: go extent-by-extent for buffered reads and writes
@ 2026-09-28  5:15 Qu Wenruo
  2026-09-28  5:15 ` [PATCH 1/2] btrfs: read a folio extent-by-extent instead of block-by-block Qu Wenruo
  2026-09-28  5:15 ` [PATCH 2/2] btrfs: write back " Qu Wenruo
  0 siblings, 2 replies; 3+ messages in thread
From: Qu Wenruo @ 2026-09-28  5:15 UTC (permalink / raw)
  To: linux-btrfs

Although we have large data folio support for a while, the buffered
reads and writes are still iterating a large folio block-by-block.

For a large block sized buffered IO, the large folio has a very high
chance to contain only one single extent.

In that case, although doing block-by-block checks is good for
readability, it's not really performant.

The series changes the behavior to do extent-by-extent iteration
instead, this can bring a very slight performance improve.

For best case scenario, the runtime to submit a folio read can be
reduced from 32us to 2.5us, and a much better distribution.

For writes it's not that obvious for the average runtime, but an obvious
improvment to the distribution.

My current guess for the lack of write performance improment is more
bio_add_folio() failure thus more bio allocations.

Qu Wenruo (2):
  btrfs: read a folio extent-by-extent instead of block-by-block
  btrfs: write back a folio extent-by-extent instead of block-by-block

 fs/btrfs/extent_io.c | 312 +++++++++++++++++++++++++------------------
 fs/btrfs/subpage.c   |  49 +++++++
 fs/btrfs/subpage.h   |   4 +
 3 files changed, 236 insertions(+), 129 deletions(-)

-- 
2.55.0


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

end of thread, other threads:[~2026-09-28  5:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-28  5:15 [PATCH 0/2] btrfs: go extent-by-extent for buffered reads and writes Qu Wenruo
2026-09-28  5:15 ` [PATCH 1/2] btrfs: read a folio extent-by-extent instead of block-by-block Qu Wenruo
2026-09-28  5:15 ` [PATCH 2/2] btrfs: write back " Qu Wenruo

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