diff options
author | Hans Holmberg <Hans.Holmberg@wdc.com> | 2025-03-10 16:39:59 +0300 |
---|---|---|
committer | Carlos Maiolino <cem@kernel.org> | 2025-03-11 14:52:27 +0300 |
commit | b7bc85480b03765a7993262f2c333628c36fbc45 (patch) | |
tree | a5a1989088f800d6fffbb8a27d3f5c6f3d15e937 | |
parent | 4c6283ec9284bb72906dba83bc7a809747e6331e (diff) | |
download | linux-b7bc85480b03765a7993262f2c333628c36fbc45.tar.xz |
xfs: trigger zone GC when out of available rt blocks
We periodically check the available rt blocks when filling up zones
and start GC if needed, but we may run completely out in between
filling zones, so start GC(unless already running) if we can't reserve
writable space.
This should only happen as a corner case in setups with very few
backing zones.
Fixes: 080d01c41d44 ("xfs: implement zoned garbage collection")
Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
-rw-r--r-- | fs/xfs/xfs_zone_space_resv.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/xfs/xfs_zone_space_resv.c b/fs/xfs/xfs_zone_space_resv.c index 4bf1b18aa7a7..93c9a7721139 100644 --- a/fs/xfs/xfs_zone_space_resv.c +++ b/fs/xfs/xfs_zone_space_resv.c @@ -160,6 +160,16 @@ xfs_zoned_reserve_available( break; /* + * Make sure to start GC if it is not running already. As we + * check the rtavailable count when filling up zones, GC is + * normally already running at this point, but in some setups + * with very few zones we may completely run out of non- + * reserved blocks in between filling zones. + */ + if (!xfs_is_zonegc_running(mp)) + wake_up_process(zi->zi_gc_thread); + + /* * If there is no reclaimable group left and we aren't still * processing a pending GC request give up as we're fully out * of space. |