bcache: Add a cond_resched() call to gc
authorKent Overstreet <kmo@daterainc.com>
Mon, 30 Nov 2015 01:18:33 +0000 (17:18 -0800)
committerJens Axboe <axboe@fb.com>
Thu, 31 Dec 2015 03:23:06 +0000 (20:23 -0700)
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tested-by: Eric Wheeler <bcache@linux.ewheeler.net>
Cc: Kent Overstreet <kmo@daterainc.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@fb.com>
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!");