]> git.ipfire.org Git - people/ms/linux.git/commit - fs/btrfs/ctree.h
btrfs: wakeup cleaner thread when adding delayed iput
authorJosef Bacik <josef@toxicpanda.com>
Fri, 11 Jan 2019 15:21:02 +0000 (10:21 -0500)
committerDavid Sterba <dsterba@suse.com>
Fri, 18 Jan 2019 16:27:23 +0000 (17:27 +0100)
commitfd340d0f68cc87badfc9efcb226f23a5428826a0
tree5b89199ba37a128eb12b289f6c1a109bbe481e1e
parent3ec9a4c81c8cc2a8d9673588dd84d9cc7c31019b
btrfs: wakeup cleaner thread when adding delayed iput

The cleaner thread usually takes care of delayed iputs, with the
exception of the btrfs_end_transaction_throttle path.  Delaying iputs
means we are potentially delaying the eviction of an inode and it's
respective space.  The cleaner thread only gets woken up every 30
seconds, or when we require space.  If there are a lot of inodes that
need to be deleted we could induce a serious amount of latency while we
wait for these inodes to be evicted.  So instead wakeup the cleaner if
it's not already awake to process any new delayed iputs we add to the
list.  If we suddenly need space we will less likely be backed up
behind a bunch of inodes that are waiting to be deleted, and we could
possibly free space before we need to get into the flushing logic which
will save us some latency.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/inode.c