]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
btrfs: replace cleaner_delayed_iput_mutex with a waitqueue
authorJosef Bacik <josef@toxicpanda.com>
Mon, 3 Dec 2018 16:06:52 +0000 (11:06 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Feb 2019 13:13:29 +0000 (14:13 +0100)
commit034f784d7cab9af731ccd41b34e5e9625ef47db7
treeef385ee06386d012cfae05bf2ca1c2003410ad0d
parent3ece54e504dc18068dee722e3dcb69d90b360988
btrfs: replace cleaner_delayed_iput_mutex with a waitqueue

The throttle path doesn't take cleaner_delayed_iput_mutex, which means
we could think we're done flushing iputs in the data space reservation
path when we could have a throttler doing an iput.  There's no real
reason to serialize the delayed iput flushing, so instead of taking the
cleaner_delayed_iput_mutex whenever we flush the delayed iputs just
replace it with an atomic counter and a waitqueue.  This removes the
short (or long depending on how big the inode is) window where we think
there are no more pending iputs when there really are some.

The waiting is killable as it could be indirectly called from user
operations like fallocate or zero-range. Such call sites should handle
the error but otherwise it's not necessary. Eg. flush_space just needs
to attempt to make space by waiting on iputs.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
[ add killable comment and changelog parts ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/inode.c