]> git.hungrycats.org Git - linux/commitdiff
btrfs: wakeup cleaner thread when adding delayed iput
authorJosef Bacik <josef@toxicpanda.com>
Wed, 21 Nov 2018 19:09:21 +0000 (14:09 -0500)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Tue, 19 Mar 2019 16:36:20 +0000 (12:36 -0400)
The cleaner thread usually takes care of delayed iputs, with the
exception of the btrfs_end_transaction_throttle path.  The cleaner
thread only gets woken up every 30 seconds, so instead wake it up to do
it's work so that we can free up that space as quickly as possible.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
(cherry picked from commit f1ddc917349870c5532420a6fd2620146d089123)
(cherry picked from commit 2276a2d607f14398fe00c96b30e3cd929399bfc5)

fs/btrfs/inode.c

index 965a64bde6fde3d846ab3ff114dfad5ba7d6085f..d7739bb2211830e3367c695c1dbf007ba2e1fc69 100644 (file)
@@ -3269,6 +3269,7 @@ void btrfs_add_delayed_iput(struct inode *inode)
        ASSERT(list_empty(&binode->delayed_iput));
        list_add_tail(&binode->delayed_iput, &fs_info->delayed_iputs);
        spin_unlock(&fs_info->delayed_iput_lock);
+       wake_up_process(fs_info->cleaner_kthread);
 }
 
 void btrfs_run_delayed_iputs(struct btrfs_fs_info *fs_info)