]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xfs: prevent gc from picking the same zone twice
authorChristoph Hellwig <hch@lst.de>
Thu, 23 Oct 2025 15:17:02 +0000 (17:17 +0200)
committerCarlos Maiolino <cem@kernel.org>
Fri, 31 Oct 2025 11:06:03 +0000 (12:06 +0100)
commit83bac569c762651ac6dff9a86f54ecc13d911f7d
tree7e0047a7af06091ab8298ca56dafdc86bbd9dcaf
parentf477af0cfa0487eddec66ffe10fd9df628ba6f52
xfs: prevent gc from picking the same zone twice

When we are picking a zone for gc it might already be in the pipeline
which can lead to us moving the same data twice resulting in in write
amplification and a very unfortunate case where we keep on garbage
collecting the zone we just filled with migrated data stopping all
forward progress.

Fix this by introducing a count of on-going GC operations on a zone, and
skip any zone with ongoing GC when picking a new victim.

Fixes: 080d01c41 ("xfs: implement zoned garbage collection")
Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Co-developed-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Tested-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/libxfs/xfs_rtgroup.h
fs/xfs/xfs_zone_gc.c