]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xfs: add support for zoned space reservations
authorChristoph Hellwig <hch@lst.de>
Thu, 13 Feb 2025 08:16:06 +0000 (09:16 +0100)
committerChristoph Hellwig <hch@lst.de>
Mon, 3 Mar 2025 15:17:07 +0000 (08:17 -0700)
commit0bb2193056b5969e4148fc0909e89a5362da873e
treeaa63e6ca6c2cbe9ada65ed931b25fa5dfaf1e70d
parent4e4d52075577707f8393e3fc74c1ef79ca1d3ce6
xfs: add support for zoned space reservations

For zoned file systems garbage collection (GC) has to take the iolock
and mmaplock after moving data to a new place to synchronize with
readers.  This means waiting for garbage collection with the iolock can
deadlock.

To avoid this, the worst case required blocks have to be reserved before
taking the iolock, which is done using a new RTAVAILABLE counter that
tracks blocks that are free to write into and don't require garbage
collection.  The new helpers try to take these available blocks, and
if there aren't enough available it wakes and waits for GC.  This is
done using a list of on-stack reservations to ensure fairness.

Co-developed-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
fs/xfs/Makefile
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/libxfs/xfs_types.h
fs/xfs/xfs_mount.c
fs/xfs/xfs_trace.h
fs/xfs/xfs_zone_alloc.c
fs/xfs/xfs_zone_alloc.h
fs/xfs/xfs_zone_priv.h
fs/xfs/xfs_zone_space_resv.c [new file with mode: 0644]