]> www.infradead.org Git - users/hch/xfsprogs.git/commit
xfs: add support for zoned space reservations
authorChristoph Hellwig <hch@lst.de>
Tue, 8 Apr 2025 07:15:06 +0000 (09:15 +0200)
committerChristoph Hellwig <hch@lst.de>
Mon, 14 Apr 2025 05:25:38 +0000 (07:25 +0200)
commitc744af5bf3b5b8576cc4cb51744d45030849d13e
tree43f5f6b84db5bf789d2b9ba39f671ab9ae3b16c3
parent7c82a854a2f9c21fa7c418e25c147665e30df358
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/xfs_bmap.c
libxfs/xfs_types.h