From 6876d2ab784645291089dd6fb325d6793cfd1c22 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Thu, 16 Jan 2020 16:20:53 -0500 Subject: 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(+) (limited to 'fs/bcachefs/rebalance.c') diff --git a/fs/bcachefs/rebalance.c b/fs/bcachefs/rebalance.c index 9eb3ac856eed..d17e3c0b7d12 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(); -- cgit v1.2.3