aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/fs.h
diff options
context:
space:
mode:
authorGravatar Naohiro Aota <naohiro.aota@wdc.com> 2023-01-10 15:04:32 +0900
committerGravatar David Sterba <dsterba@suse.com> 2023-01-11 20:04:25 +0100
commit85e79ec7b78f863178ca488fd8cb5b3de6347756 (patch)
treee82af35b0665a31bb3590991e827d0bdf2dafcb3 /fs/btrfs/fs.h
parentbtrfs: qgroup: do not warn on record without old_roots populated (diff)
downloadlinux-85e79ec7b78f863178ca488fd8cb5b3de6347756.tar.gz
linux-85e79ec7b78f863178ca488fd8cb5b3de6347756.tar.bz2
linux-85e79ec7b78f863178ca488fd8cb5b3de6347756.zip
btrfs: zoned: enable metadata over-commit for non-ZNS setup
The commit 79417d040f4f ("btrfs: zoned: disable metadata overcommit for zoned") disabled the metadata over-commit to track active zones properly. However, it also introduced a heavy overhead by allocating new metadata block groups and/or flushing dirty buffers to release the space reservations. Specifically, a workload (write only without any sync operations) worsen its performance from 343.77 MB/sec (v5.19) to 182.89 MB/sec (v6.0). The performance is still bad on current misc-next which is 187.95 MB/sec. And, with this patch applied, it improves back to 326.70 MB/sec (+73.82%). This patch introduces a new fs_info->flag BTRFS_FS_NO_OVERCOMMIT to indicate it needs to disable the metadata over-commit. The flag is enabled when a device with max active zones limit is loaded into a file-system. Fixes: 79417d040f4f ("btrfs: zoned: disable metadata overcommit for zoned") CC: stable@vger.kernel.org # 6.0+ Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/fs.h')
-rw-r--r--fs/btrfs/fs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/fs.h b/fs/btrfs/fs.h
index a749367e5ae2..37b86acfcbcf 100644
--- a/fs/btrfs/fs.h
+++ b/fs/btrfs/fs.h
@@ -119,6 +119,12 @@ enum {
/* Indicate that we want to commit the transaction. */
BTRFS_FS_NEED_TRANS_COMMIT,
+ /*
+ * Indicate metadata over-commit is disabled. This is set when active
+ * zone tracking is needed.
+ */
+ BTRFS_FS_NO_OVERCOMMIT,
+
#if BITS_PER_LONG == 32
/* Indicate if we have error/warn message printed on 32bit systems */
BTRFS_FS_32BIT_ERROR,