From 6876d2ab784645291089dd6fb325d6793cfd1c22 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Thu, 16 Jan 2020 16:20:53 -0500 Subject: [PATCH] bcachefs: Add a cond_resched() to rebalance loop Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet --- fs/bcachefs/rebalance.c | 2 ++ 1 file changed, 2 insertions(+) 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(); -- 2.50.1