From: Brian Foster <bfoster@redhat.com>
To: Kevin Hao <haokexin@gmail.com>
Cc: linux-bcachefs@vger.kernel.org,
Kent Overstreet <kent.overstreet@linux.dev>
Subject: Re: [PATCH] bcachefs: Remove unnecessary kthread_should_stop()
Date: Tue, 19 Dec 2023 08:01:59 -0500 [thread overview]
Message-ID: <ZYGUR4qD2mzr1X4F@bfoster> (raw)
In-Reply-To: <20231216015140.2085664-1-haokexin@gmail.com>
On Sat, Dec 16, 2023 at 09:51:40AM +0800, Kevin Hao wrote:
> In the macro kthread_wait_freezable(), there is already a check for
> kthread_should_stop(), so there is no need to pass kthread_should_stop()
> as a parameter to kthread_wait_freezable().
>
> Signed-off-by: Kevin Hao <haokexin@gmail.com>
> ---
Looks right to me:
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/bcachefs/movinggc.c | 3 +--
> fs/bcachefs/rebalance.c | 3 +--
> 2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c
> index fd239a261aca..bc1ec877a66b 100644
> --- a/fs/bcachefs/movinggc.c
> +++ b/fs/bcachefs/movinggc.c
> @@ -345,8 +345,7 @@ static int bch2_copygc_thread(void *arg)
>
> if (!c->copy_gc_enabled) {
> move_buckets_wait(&ctxt, buckets, true);
> - kthread_wait_freezable(c->copy_gc_enabled ||
> - kthread_should_stop());
> + kthread_wait_freezable(c->copy_gc_enabled);
> }
>
> if (unlikely(freezing(current))) {
> diff --git a/fs/bcachefs/rebalance.c b/fs/bcachefs/rebalance.c
> index ee452aa51a26..b83dd613e247 100644
> --- a/fs/bcachefs/rebalance.c
> +++ b/fs/bcachefs/rebalance.c
> @@ -334,8 +334,7 @@ static int do_rebalance(struct moving_context *ctxt)
> while (!bch2_move_ratelimit(ctxt)) {
> if (!r->enabled) {
> bch2_moving_ctxt_flush_all(ctxt);
> - kthread_wait_freezable(r->enabled ||
> - kthread_should_stop());
> + kthread_wait_freezable(r->enabled);
> }
>
> if (kthread_should_stop())
> --
> 2.39.2
>
next prev parent reply other threads:[~2023-12-19 13:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-16 1:51 [PATCH] bcachefs: Remove unnecessary kthread_should_stop() Kevin Hao
2023-12-19 13:01 ` Brian Foster [this message]
2023-12-19 20:55 ` Kent Overstreet
2024-01-04 11:49 ` Brian Foster
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=ZYGUR4qD2mzr1X4F@bfoster \
--to=bfoster@redhat.com \
--cc=haokexin@gmail.com \
--cc=kent.overstreet@linux.dev \
--cc=linux-bcachefs@vger.kernel.org \
/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