]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xfs: streamline GC zone selection
authorChristoph Hellwig <hch@lst.de>
Tue, 31 Mar 2026 15:27:28 +0000 (17:27 +0200)
committerCarlos Maiolino <cem@kernel.org>
Tue, 7 Apr 2026 11:28:47 +0000 (13:28 +0200)
commit4c1b6e03e31c5933355f25fe7fa564be3a0f931d
tree11dac6ac8c25b722c5fa576921bea75fe07a453f
parent53c1c822908d9804504596486b96d8b887b0bacd
xfs: streamline GC zone selection

Currently picking of the GC target zone is a bit odd as it is done both
in the main "can we start new GC cycles" routine and in the low-level
block allocator for GC.  This was mostly done to work around the rules
for when code in a waitqueue wait loop can sleep.

But with a trick to check if the process state has been set to running to
discover if the wait loop has to be retried, all this becomes much
simpler.  We can select a GC zone just before writing, and bail out of
starting new work if we can't find a usable zone.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_zone_gc.c