Skip to content

Commit b7bc854

Browse files
yhrcmaiolino
authored andcommitted
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: 080d01c ("xfs: implement zoned garbage collection") Signed-off-by: Hans Holmberg <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Carlos Maiolino <[email protected]>
1 parent 4c6283e commit b7bc854

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

fs/xfs/xfs_zone_space_resv.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,16 @@ xfs_zoned_reserve_available(
159159
if (error != -ENOSPC)
160160
break;
161161

162+
/*
163+
* Make sure to start GC if it is not running already. As we
164+
* check the rtavailable count when filling up zones, GC is
165+
* normally already running at this point, but in some setups
166+
* with very few zones we may completely run out of non-
167+
* reserved blocks in between filling zones.
168+
*/
169+
if (!xfs_is_zonegc_running(mp))
170+
wake_up_process(zi->zi_gc_thread);
171+
162172
/*
163173
* If there is no reclaimable group left and we aren't still
164174
* processing a pending GC request give up as we're fully out

0 commit comments

Comments
 (0)