• Chris Mason's avatar
    Btrfs: don't force chunk allocation in find_free_extent · 0e4f8f88
    Chris Mason authored
    find_free_extent likes to allocate in contiguous clusters,
    which makes writeback faster, especially on SSD storage.  As
    the FS fragments, these clusters become harder to find and we have
    to decide between allocating a new chunk to make more clusters
    or giving up on the cluster to allocate from the free space
    we have.
    
    Right now it creates too many chunks, and you can end up with
    a whole FS that is mostly empty metadata chunks.  This commit
    changes the allocation code to be more strict and only
    allocate new chunks when we've made good use of the chunks we
    already have.
    Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
    0e4f8f88
extent-tree.c 233 KB