]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: wake up inode cache waiters sooner to reduce waiting time
authorFilipe Manana <fdmanana@suse.com>
Thu, 4 Jul 2019 15:25:00 +0000 (16:25 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 9 Sep 2019 12:59:02 +0000 (14:59 +0200)
commit848a37b62e9ee4c790e6ee83dccdeb002a0e2672
tree760787e843caaa309ba684527803102ed41f039c
parentee1cca115536ed9b59570a2d2f7d0d190ba3e39c
Btrfs: wake up inode cache waiters sooner to reduce waiting time

If we need to start an inode caching thread, because none currently exists
on disk, we can wake up all waiters as soon as we mark the range starting
at root's highest objectid + 1 and ending at BTRFS_LAST_FREE_OBJECTID as
free, so that they don't need to wait for the caching thread to start and
do some progress. We follow the same approach within the caching thread,
since as soon as it finds a free range and marks it as free space in the
cache, it wakes up all waiters. So improve this by adding such a wakeup
call after marking that initial range as free space.

Fixes: f0b8502ce7cb57 ("Btrfs: setup free ino caching in a more asynchronous way")
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode-map.c