• Naohiro Aota's avatar
    btrfs: zoned: enable metadata over-commit for non-ZNS setup · 85e79ec7
    Naohiro Aota authored
    The commit 79417d04 ("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: 79417d04 ("btrfs: zoned: disable metadata overcommit for zoned")
    CC: stable@vger.kernel.org # 6.0+
    Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
    Signed-off-by: default avatarNaohiro Aota <naohiro.aota@wdc.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    85e79ec7
space-info.c 57.9 KB