Skip to content
  • Josef Bacik's avatar
    btrfs: run delayed iput at unlink time · 63611e73
    Josef Bacik authored
    
    
    We have been seeing issues in production where a cleaner script will end
    up unlinking a bunch of files that have pending iputs.  This means they
    will get their final iput's run at btrfs-cleaner time and thus are not
    throttled, which impacts the workload.
    
    Since we are unlinking these files we can just drop the delayed iput at
    unlink time.  We are already holding a reference to the inode so this
    will not be the final iput and thus is completely safe to do at this
    point.  Doing this means we are more likely to be doing the final iput
    at unlink time, and thus will get the IO charged to the caller and get
    throttled appropriately without affecting the main workload.
    
    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>
    63611e73