• Christoph Hellwig's avatar
    xfs: do not discard alloc btree blocks · 55a7bc5a
    Christoph Hellwig authored
    Blocks for the allocation btree are allocated from and released to
    the AGFL, and thus frequently reused.  Even worse we do not have an
    easy way to avoid using an AGFL block when it is discarded due to
    the simple FILO list of free blocks, and thus can frequently stall
    on blocks that are currently undergoing a discard.
    
    Add a flag to the busy extent tracking structure to skip the discard
    for allocation btree blocks.  In normal operation these blocks are
    reused frequently enough that there is no need to discard them
    anyway, but if they spill over to the allocation btree as part of a
    balance we "leak" blocks that we would otherwise discard.  We could
    fix this by adding another flag and keeping these block in the
    rbtree even after they aren't busy any more so that we could discard
    them when they migrate out of the AGFL.  Given that this would cause
    significant overhead I don't think it's worthwile for now.
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarAlex Elder <aelder@sgi.com>
    55a7bc5a
xfs_ag.h 10.2 KB