xfs: drop firstblock constraints from allocation setup
authorDave Chinner <dchinner@redhat.com>
Fri, 10 Feb 2023 17:10:06 +0000 (04:10 +1100)
committerDave Chinner <dchinner@redhat.com>
Fri, 10 Feb 2023 17:10:06 +0000 (04:10 +1100)
commit36b6ad2d9cb81b0d52ae1598286ca5809cd39003
treef1b293210b529106c6e07b2551dd9310a1a6acca
parentd5753847b216db0e553e8065aa825cfe497ad143
xfs: drop firstblock constraints from allocation setup

Now that xfs_alloc_vextent() does all the AGF deadlock prevention
filtering for multiple allocations in a single transaction, we no
longer need the allocation setup code to care about what AGs we
might already have locked.

Hence we can remove all the "nullfb" conditional logic in places
like xfs_bmap_btalloc() and instead have them focus simply on
setting up locality constraints. If the allocation fails due to
AGF lock filtering in xfs_alloc_vextent, then we just fall back as
we normally do to more relaxed allocation constraints.

As a result, any allocation that allows AG scanning (i.e. not
confined to a single AG) and does not force a worst case full
filesystem scan will now be able to attempt allocation from AGs
lower than that defined by tp->t_firstblock. This is because
xfs_alloc_vextent() allows try-locking of the AGFs and hence enables
low space algorithms to at least -try- to get space from AGs lower
than the one that we have currently locked and allocated from. This
is a significant improvement in the low space allocation algorithm.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/libxfs/xfs_bmap_btree.c