From: Kent Overstreet Date: Thu, 16 Jan 2020 21:20:53 +0000 (-0500) Subject: bcachefs: Add a cond_resched() to rebalance loop X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6876d2ab784645291089dd6fb325d6793cfd1c22;p=linux.git bcachefs: Add a cond_resched() to rebalance loop Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/rebalance.c b/fs/bcachefs/rebalance.c index 9eb3ac856eed7..d17e3c0b7d12e 100644 --- a/fs/bcachefs/rebalance.c +++ b/fs/bcachefs/rebalance.c @@ -183,6 +183,8 @@ static int bch2_rebalance_thread(void *arg) prev_cputime = curr_cputime(); while (!kthread_wait_freezable(r->enabled)) { + cond_resched(); + start = jiffies; cputime = curr_cputime();