From 9e5c353510b26500bd6b8309823ac9ef2837b761 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 1 May 2014 13:48:57 -0700 Subject: bcache: fix uninterruptible sleep in writeback thread There were two issues here: - writeback thread did not start until the device first became dirty - writeback thread used uninterruptible sleep once running Without this patch I see kernel warnings printed and a load average of 1.52 after booting my test VM. With this patch the warnings are gone and the load average is near 0.00 as expected. Signed-off-by: Kent Overstreet --- drivers/md/bcache/super.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/md/bcache/super.c') diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 3b043a04d9bd..00cc42550f34 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1042,6 +1042,9 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c) */ atomic_set(&dc->count, 1); + if (bch_cached_dev_writeback_start(dc)) + return -ENOMEM; + if (BDEV_STATE(&dc->sb) == BDEV_STATE_DIRTY) { bch_sectors_dirty_init(dc); atomic_set(&dc->has_dirty, 1); -- cgit v1.2.3