From: Kent Overstreet Date: Tue, 25 May 2021 22:42:05 +0000 (-0400) Subject: bcachefs: Add a cond_resched call to the copygc main loop X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c4d4b2f01abd95af7c6dccf236e2760aef5a9b69;p=linux.git 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 --- diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c index acb4d943db79e..e8f9d70af9302 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;