public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] btrfs: introduce async_csum feature
@ 2025-10-24 10:49 Qu Wenruo
  2025-10-24 10:49 ` [PATCH 1/4] btrfs: make sure all btrfs_bio::end_io is called in task context Qu Wenruo
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Qu Wenruo @ 2025-10-24 10:49 UTC (permalink / raw)
  To: linux-btrfs

The new async_csum feature will allow btrfs to calculate checksum for
data write bios and submit them in parallel.

This will reduce latency and improve write throughput when data checksum
is utilized.

This will slightly reclaim the performance drop after commit
968f19c5b1b7 ("btrfs: always fallback to buffered write if the inode
requires checksum").

The first patch makes sure btrfs_bio::end_io() is executed in task
context, as we will need to wait for csum calculation to finish before
end_io() function.

Then patch 2~3 are small cleanups related to the new task context of
end_io().

The last one enables async_csum for data writes with checksum, this will
slightly change the behavior of data checksum offload feature (offload
data checksum calculation to another thread, but still doing serial
calculation then submit behavior).

Since the new async_csum should be better than the csum offload anyway,
we may want to deprecate the csum offload feature completely in the
future.
Thankfully csum offload feature is still behind the experimental flag,
thus it should not affect end users.

Qu Wenruo (4):
  btrfs: make sure all btrfs_bio::end_io is called in task context
  btrfs: remove btrfs_fs_info::compressed_write_workers
  btrfs: relax btrfs_inode::ordered_tree_lock
  btrfs: introduce btrfs_bio::async_csum

 fs/btrfs/bio.c          | 79 +++++++++++++++++++++++++++++------------
 fs/btrfs/bio.h          |  5 +++
 fs/btrfs/compression.c  | 27 +++++---------
 fs/btrfs/compression.h  |  7 ++--
 fs/btrfs/disk-io.c      |  9 ++---
 fs/btrfs/extent_io.c    |  5 ++-
 fs/btrfs/file-item.c    | 61 +++++++++++++++++++++----------
 fs/btrfs/file-item.h    |  2 +-
 fs/btrfs/fs.h           |  1 -
 fs/btrfs/inode.c        |  4 +--
 fs/btrfs/ordered-data.c | 57 +++++++++++++----------------
 fs/btrfs/tree-log.c     |  4 +--
 12 files changed, 148 insertions(+), 113 deletions(-)

-- 
2.51.0


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

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

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-24 10:49 [PATCH 0/4] btrfs: introduce async_csum feature Qu Wenruo
2025-10-24 10:49 ` [PATCH 1/4] btrfs: make sure all btrfs_bio::end_io is called in task context Qu Wenruo
2025-10-24 10:49 ` [PATCH 2/4] btrfs: remove btrfs_fs_info::compressed_write_workers Qu Wenruo
2025-10-24 10:49 ` [PATCH 3/4] btrfs: relax btrfs_inode::ordered_tree_lock Qu Wenruo
2025-10-24 10:49 ` [PATCH 4/4] btrfs: introduce btrfs_bio::async_csum Qu Wenruo
2025-10-24 10:58   ` Christoph Hellwig
2025-10-24 22:15     ` Qu Wenruo
2025-10-24 22:51       ` Eric Biggers
2025-10-24 23:13         ` Qu Wenruo
2025-10-24 14:51   ` Boris Burkov
2025-10-24 21:40     ` Qu Wenruo
2025-10-28  7:19   ` kernel test robot
2025-10-28  8:06     ` Qu Wenruo
2025-10-28 10:15       ` Qu Wenruo

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