summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-05-25 18:42:05 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2021-05-25 18:42:55 -0400
commitadc9a87e10945b0fc602d3423822c9d5f41000e9 (patch)
tree621a6679c7874d497861e34b93a2e7409da7df6e
parent30694330463fdaa6dbbb7d089b8cc0fdf2547c90 (diff)
bcachefs: Add a cond_resched call to the copygc main loop
We seem to have a bug where the copygc thread ends up spinning and making the system unusable - this will at least prevent it from locking up the machine, and it's a good thing to have anyways. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--fs/bcachefs/movinggc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c
index 61c5901f0980..0963c4969421 100644
--- a/fs/bcachefs/movinggc.c
+++ b/fs/bcachefs/movinggc.c
@@ -317,6 +317,8 @@ static int bch2_copygc_thread(void *arg)
set_freezable();
while (!kthread_should_stop()) {
+ cond_resched();
+
if (kthread_wait_freezable(c->copy_gc_enabled))
break;