]> git.ipfire.org Git - thirdparty/linux.git/commit
xfs: rework zone GC buffer management
authorChristoph Hellwig <hch@lst.de>
Wed, 14 Jan 2026 13:06:43 +0000 (14:06 +0100)
committerCarlos Maiolino <cem@kernel.org>
Wed, 21 Jan 2026 11:57:16 +0000 (12:57 +0100)
commit102f444b57b35e41b04a5c8192fcdacb467c9161
tree3fb43568ba6403946f9c205821824655a2c104fd
parent0506d32f7c52e41f6e8db7c337e0ce6374c6ffbb
xfs: rework zone GC buffer management

The double buffering where just one scratch area is used at a time does
not efficiently use the available memory.  It was originally implemented
when GC I/O could happen out of order, but that was removed before
upstream submission to avoid fragmentation.  Now that all GC I/Os are
processed in order, just use a number of buffers as a simple ring buffer.

For a synthetic benchmark that fills 256MiB HDD zones and punches out
holes to free half the space this leads to a decrease of GC time by
a little more than 25%.

Thanks to Hans Holmberg <hans.holmberg@wdc.com> for testing and
benchmarking.

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