* [PATCH 5/5] Btrfs: wake up inode cache waiters sooner to reduce waiting time
@ 2019-07-04 15:25 fdmanana
2019-07-08 6:34 ` Nikolay Borisov
0 siblings, 1 reply; 2+ messages in thread
From: fdmanana @ 2019-07-04 15:25 UTC (permalink / raw)
To: linux-btrfs
From: Filipe Manana <fdmanana@suse.com>
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: a47d6b70e28040 ("Btrfs: setup free ino caching in a more asynchronous way")
Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
fs/btrfs/inode-map.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/btrfs/inode-map.c b/fs/btrfs/inode-map.c
index 4820e05ea6bd..cb107d168019 100644
--- a/fs/btrfs/inode-map.c
+++ b/fs/btrfs/inode-map.c
@@ -175,6 +175,7 @@ static void start_caching(struct btrfs_root *root)
if (!ret && objectid <= BTRFS_LAST_FREE_OBJECTID) {
__btrfs_add_free_space(fs_info, ctl, objectid,
BTRFS_LAST_FREE_OBJECTID - objectid + 1);
+ wake_up(&root->ino_cache_wait);
}
tsk = kthread_run(caching_kthread, root, "btrfs-ino-cache-%llu",
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 5/5] Btrfs: wake up inode cache waiters sooner to reduce waiting time
2019-07-04 15:25 [PATCH 5/5] Btrfs: wake up inode cache waiters sooner to reduce waiting time fdmanana
@ 2019-07-08 6:34 ` Nikolay Borisov
0 siblings, 0 replies; 2+ messages in thread
From: Nikolay Borisov @ 2019-07-08 6:34 UTC (permalink / raw)
To: fdmanana, linux-btrfs
On 4.07.19 г. 18:25 ч., fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> 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: a47d6b70e28040 ("Btrfs: setup free ino caching in a more asynchronous way")
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
> ---
> fs/btrfs/inode-map.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/btrfs/inode-map.c b/fs/btrfs/inode-map.c
> index 4820e05ea6bd..cb107d168019 100644
> --- a/fs/btrfs/inode-map.c
> +++ b/fs/btrfs/inode-map.c
> @@ -175,6 +175,7 @@ static void start_caching(struct btrfs_root *root)
> if (!ret && objectid <= BTRFS_LAST_FREE_OBJECTID) {
> __btrfs_add_free_space(fs_info, ctl, objectid,
> BTRFS_LAST_FREE_OBJECTID - objectid + 1);
> + wake_up(&root->ino_cache_wait);
> }
>
> tsk = kthread_run(caching_kthread, root, "btrfs-ino-cache-%llu",
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-08 6:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-04 15:25 [PATCH 5/5] Btrfs: wake up inode cache waiters sooner to reduce waiting time fdmanana
2019-07-08 6:34 ` Nikolay Borisov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox