]> www.infradead.org Git - users/hch/xfs.git/commit
xfs: reduce excessive clamping of maxlen in xfs_rtallocate_extent_near
authorDarrick J. Wong <djwong@kernel.org>
Fri, 30 Aug 2024 22:37:05 +0000 (15:37 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Sun, 1 Sep 2024 15:58:19 +0000 (08:58 -0700)
commit74c234bbe51a1b142400ab018b605e2f16274e10
treee2f389cbcb21aea75e441a29c2d47f2ee3933814
parent62c3d2496808ab47714906e24eed67cfdf5735c7
xfs: reduce excessive clamping of maxlen in xfs_rtallocate_extent_near

The near rt allocator employs two allocation strategies -- first it
tries to allocate at exactly @start.  If that fails, it will pivot back
and forth around that starting point looking for an appropriately sized
free space.

However, I clamped maxlen ages ago to prevent the exact allocation scan
from running off the end of the rt volume.  This, I realize, was
excessive.  If the allocation request is (say) for 32 rtx but the start
position is 5 rtx from the end of the volume, we clamp maxlen to 5.  If
the exact allocation fails, we then pivot back and forth looking for 5
rtx, even though the original intent was to try to get 32 rtx.

If we then find 5 rtx when we could have gotten 32 rtx, we've not done
as well as we could have.  This may be moot if the caller immediately
comes back for more space, but it might not be.  Either way, we can do
better here.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_rtalloc.c