]> www.infradead.org Git - users/hch/xfsprogs.git/commit
xfs: add support for zoned space reservations
authorChristoph Hellwig <hch@lst.de>
Fri, 6 Dec 2024 10:21:10 +0000 (19:21 +0900)
committerChristoph Hellwig <hch@lst.de>
Sat, 7 Dec 2024 07:41:01 +0000 (16:41 +0900)
commite12f804c91c9c764c528d24fd62b28d014cd3d4c
tree1044f3747bc619bba16f078e6edf9b5e04fc7f8f
parent49efca711867049039d4db502bdb7f185ef75fe3
xfs: add support for zoned space reservations

Source kernel commit: e664c681e622774e932446e2c19c71bd4ecf0808

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>
libxfs/xfs_bmap.c