From: Chao Yu <chao@kernel.org>
To: Wenjie Qi <qwjhust@gmail.com>, jaegeuk@kernel.org
Cc: chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, qiwenjie@xiaomi.com
Subject: Re: [PATCH] f2fs: avoid cache writeback busy loop with zero thresholds
Date: Fri, 9 Oct 2026 16:29:55 +0800 [thread overview]
Message-ID: <29c03ab9-fdf8-4e45-8432-84690e656157@kernel.org> (raw)
In-Reply-To: <20261009035354.3330915-1-qiwenjie@xiaomi.com>
On 10/9/26 11:53, Wenjie Qi wrote:
> When both cache writeback thresholds are zero,
> f2fs_should_wake_up_cache_wb() returns true even with no dirty caches.
> This makes wait_event_freezable_timeout() return immediately and the
> writeback thread busy-loop instead of waiting for its periodic timeout.
>
> Return false when both thresholds are disabled so periodic writeback
> can proceed without busy-looping.
>
> Fixes: d7f084b1ad93 ("f2fs: cache: wake up f2fs_writeback when exceeding threshold")
> Signed-off-by: Wenjie Qi <qiwenjie@xiaomi.com>
> ---
> Based on f2fs/dev-test at ce439a2b0690.
>
> fs/f2fs/cache.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/cache.c b/fs/f2fs/cache.c
> index c76c4660606c5..88d4e479c8469 100644
> --- a/fs/f2fs/cache.c
> +++ b/fs/f2fs/cache.c
> @@ -740,7 +740,8 @@ static inline bool f2fs_should_wake_up_cache_wb(struct f2fs_sb_info *sbi)
> nr_dirty < cache_thread->cache_wb_dirty_threshold)
> return false;
>
> - return true;
> + return cache_thread->cache_wb_total_threshold ||
> + cache_thread->cache_wb_dirty_threshold;
Thanks for the fix, do you mind I fold this into original patch? as it
is still in dev-test.
Thanks,
> }
>
> static int f2fs_cache_writeback_kthread(void *data)
next prev parent reply other threads:[~2026-10-09 8:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-09 3:53 Wenjie Qi
2026-10-09 8:29 ` Chao Yu [this message]
2026-10-09 8:44 ` Wenjie Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=29c03ab9-fdf8-4e45-8432-84690e656157@kernel.org \
--to=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=qiwenjie@xiaomi.com \
--cc=qwjhust@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®