Skip to content

Commit 4eef29e

Browse files
naotakdave
authored andcommitted
btrfs: zoned: do not use async metadata checksum on zoned filesystems
On zoned filesystems, btrfs uses per-fs zoned_meta_io_lock to serialize the metadata write IOs. Even with this serialization, write bios sent from btree_write_cache_pages can be reordered by async checksum workers as these workers are per CPU and not per zone. To preserve write bio ordering, we disable async metadata checksum on a zoned filesystem. This does not result in lower performance with HDDs as a single CPU core is fast enough to do checksum for a single zone write stream with the maximum possible bandwidth of the device. If multiple zones are being written simultaneously, HDD seek overhead lowers the achievable maximum bandwidth, resulting again in a per zone checksum serialization not affecting the performance. Reviewed-by: Josef Bacik <[email protected]> Signed-off-by: Naohiro Aota <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 24c0a72 commit 4eef29e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/btrfs/disk-io.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,8 @@ static blk_status_t btree_submit_bio_start(struct inode *inode, struct bio *bio,
871871
static int check_async_write(struct btrfs_fs_info *fs_info,
872872
struct btrfs_inode *bi)
873873
{
874+
if (btrfs_is_zoned(fs_info))
875+
return 0;
874876
if (atomic_read(&bi->sync_writers))
875877
return 0;
876878
if (test_bit(BTRFS_FS_CSUM_IMPL_FAST, &fs_info->flags))

0 commit comments

Comments
 (0)