]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs: drop firstblock constraints from allocation setup
authorDave Chinner <dchinner@redhat.com>
Tue, 9 May 2023 09:29:39 +0000 (11:29 +0200)
committerCarlos Maiolino <cem@kernel.org>
Tue, 9 May 2023 17:53:57 +0000 (19:53 +0200)
commit80375d24686d626e3404a685c35c1e3a3a3e9173
tree64f3faa630fb3a4d2f708949d064312bf2e77573
parent4442ae9597d36096e40d32cfbb0b6ed1e40097e4
xfs: drop firstblock constraints from allocation setup

Source kernel commit: 36b6ad2d9cb81b0d52ae1598286ca5809cd39003

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>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
libxfs/xfs_bmap.c
libxfs/xfs_bmap_btree.c