]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: add support for zoned space reservations
authorChristoph Hellwig <hch@lst.de>
Mon, 14 Apr 2025 05:36:02 +0000 (07:36 +0200)
committerAndrey Albershteyn <aalbersh@kernel.org>
Tue, 29 Apr 2025 16:09:57 +0000 (18:09 +0200)
commitd22f260a04fe1f71fbff9a0cae125d61634c8d70
treef912b661e9869d248b309a73095f37ce63264825
parent7681c8b64e8150667ea2d23e5134ffb5924b6607
xfs: add support for zoned space reservations

Source kernel commit: 0bb2193056b5969e4148fc0909e89a5362da873e

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>
Signed-off-by: Christoph Hellwig <hch@lst.de>
libxfs/libxfs_priv.h
libxfs/xfs_bmap.c
libxfs/xfs_types.h