• Dave Chinner's avatar
    xfs: drop firstblock constraints from allocation setup · 36b6ad2d
    Dave Chinner authored
    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: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarAllison Henderson <allison.henderson@oracle.com>
    Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
    36b6ad2d
xfs_bmap.c 163 KB