]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: run delayed iput at unlink time
authorJosef Bacik <josef@toxicpanda.com>
Tue, 18 Jun 2019 14:59:18 +0000 (10:59 -0400)
committerDavid Sterba <dsterba@suse.com>
Tue, 2 Jul 2019 10:30:50 +0000 (12:30 +0200)
commitc7d92a70c26de8d9fe28169adf1a11f44af1e7bf
tree44265c54059f11c852f135b901cc011f8971f882
parent6e407e50f885c1fc85ddf3d0841671c261f8b9f4
btrfs: run delayed iput at unlink time

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: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c