bcachefs: Add a cond_resched() to rebalance loop
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 16 Jan 2020 21:20:53 +0000 (16:20 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:34 +0000 (17:08 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/rebalance.c

index 9eb3ac856eed70e20f4597e3a73340dd5a2fbd33..d17e3c0b7d12e169ab121b02a191430dbc3a2980 100644 (file)
@@ -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();