• Josef Bacik's avatar
    btrfs: only ignore delalloc if delalloc is much smaller than ordered · 3e101569
    Josef Bacik authored
    While testing heavy delalloc workloads I noticed that sometimes we'd
    just stop preemptively flushing when we had loads of delalloc available
    to flush.  This is because we skip preemptive flushing if delalloc <=
    ordered.  However if we start with say 4gib of delalloc, and we flush
    2gib of that, we'll stop flushing there, when we still have 2gib of
    delalloc to flush.
    
    Instead adjust the ordered bytes down by half, this way if 2/3 of our
    outstanding delalloc reservations are tied up by ordered extents we
    don't bother preemptive flushing, as we're getting close to the state
    where we need to wait on ordered extents.
    Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    3e101569
space-info.c 53.9 KB