• Josef Bacik's avatar
    btrfs: implement space clamping for preemptive flushing · 88a777a6
    Josef Bacik authored
    Starting preemptive flushing at 50% of available free space is a good
    start, but some workloads are particularly abusive and can quickly
    overwhelm the preemptive flushing code and drive us into using tickets.
    
    Handle this by clamping down on our threshold for starting and
    continuing to run preemptive flushing.  This is particularly important
    for our overcommit case, as we can really drive the file system into
    overages and then it's more difficult to pull it back as we start to
    actually fill up the file system.
    
    The clamping is essentially 2^CLAMP, but we start at 1 so whatever we
    calculate for overcommit is the baseline.
    Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
    Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    88a777a6
space-info.h 5.66 KB