bcachefs: Remove unnecessary kthread_should_stop()
PATCH 1/1 bcachefs: Remove unnecessary kthread_should_stop()
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().
--- fs/bcachefs/movinggc.c | 3 +-- fs/bcachefs/rebalance.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
fs/bcachefs/movinggc.c +1 -2
@@ -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))) {
fs/bcachefs/rebalance.c +1 -2
@@ -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 ())
Signature · 1 line
2.39.2
Quoted 6 lines · Kevin Hao
In the macro
kthread_wait_freezable(), there is already a check forkthread_should_stop(), so there is no need to passkthread_should_stop()as a parameter tokthread_wait_freezable().Signed-off-by Kevin Hao <[email protected]>---
Looks right to me:
Quoted 35 lines
fs/bcachefs/movinggc.c | 3 +-- fs/bcachefs/rebalance.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)fs/bcachefs/movinggc.c +1
-2@@ -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))) {fs/bcachefs/rebalance.c +1
-2@@ -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 ())Signature · 1 line
2.39.2
Quoted 11 lines · Brian Foster
Quoted 6 lines · Kevin Hao
In the macro
kthread_wait_freezable(), there is already a check forkthread_should_stop(), so there is no need to passkthread_should_stop()as a parameter tokthread_wait_freezable().Signed-off-by Kevin Hao <[email protected]>---
Looks right to me:
Reviewed-by Brian Foster <[email protected]>
It is technically correct, but recently the issues have been more with having too few kthread_should_stop() calls, not too many; I think I want to leave this for now, even though it's redundant it's more explicit.
Quoted 9 lines · Kent Overstreet
Quoted 8 lines · Brian Foster
Quoted 6 lines · Kevin Hao
In the macro
kthread_wait_freezable(), there is already a check forkthread_should_stop(), so there is no need to passkthread_should_stop()as a parameter tokthread_wait_freezable().Signed-off-by Kevin Hao <[email protected]>---
Quoted 8 lines
Quoted 3 lines
Looks right to me:
Reviewed-by Brian Foster <[email protected]>It is technically correct, but recently the issues have been more with having too few
kthread_should_stop()calls, not too many; I think I want to leave this for now, even though it's redundant it's more explicit.
What recent issues do you mean? ISTM this logic serves more as a placebo than anything. Is there a more explicit issue to dig into?
Brian