• Naohiro Aota's avatar
    btrfs: zoned: optimize hint byte for zoned allocator · 02444f2a
    Naohiro Aota authored
    Writing sequentially to a huge file on btrfs on a SMR HDD revealed a
    decline of the performance (220 MiB/s to 30 MiB/s after 500 minutes).
    
    The performance goes down because of increased latency of the extent
    allocation, which is induced by a traversing of a lot of full block groups.
    
    So, this patch optimizes the ffe_ctl->hint_byte by choosing a block group
    with sufficient size from the active block group list, which does not
    contain full block groups.
    
    After applying the patch, the performance is maintained well.
    
    Fixes: 2eda5708 ("btrfs: zoned: implement sequential extent allocation")
    CC: stable@vger.kernel.org # 5.15+
    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>
    02444f2a
extent-tree.c 175 KB