bcache: Add a cond_resched() call to gc
authorKent Overstreet <[email protected]>
Mon, 30 Nov 2015 01:18:33 +0000 (17:18 -0800)
committerJens Axboe <[email protected]>
Thu, 31 Dec 2015 03:23:06 +0000 (20:23 -0700)
Signed-off-by: Takashi Iwai <[email protected]>
Tested-by: Eric Wheeler <[email protected]>
Cc: Kent Overstreet <[email protected]>
Cc: [email protected]
Signed-off-by: Jens Axboe <[email protected]>
drivers/md/bcache/btree.c

index 4a1179cbc52e93a0dd0d56b88932af4b27399ccc..22b9e34ceb75c5318a25870bf346a27ba2e64052 100644 (file)
@@ -1741,6 +1741,7 @@ static void bch_btree_gc(struct cache_set *c)
        do {
                ret = btree_root(gc_root, c, &op, &writes, &stats);
                closure_sync(&writes);
+               cond_resched();
 
                if (ret && ret != -EAGAIN)
                        pr_warn("gc failed!");