summaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/super.c
diff options
context:
space:
mode:
authorSlava Pestov <sp@daterainc.com>2014-05-01 13:48:57 -0700
committerKent Overstreet <kmo@daterainc.com>2014-08-04 15:23:03 -0700
commit9e5c353510b26500bd6b8309823ac9ef2837b761 (patch)
treeff1ff3500ed20d3b9ac2dc3338e1d6ad87e9e0ea /drivers/md/bcache/super.c
parentc5aa4a3157b55bdca18dd2a9d9f43314470b6d32 (diff)
downloadblackbird-op-linux-9e5c353510b26500bd6b8309823ac9ef2837b761.tar.gz
blackbird-op-linux-9e5c353510b26500bd6b8309823ac9ef2837b761.zip
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 <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/super.c')
-rw-r--r--drivers/md/bcache/super.c3
1 files changed, 3 insertions, 0 deletions
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);
OpenPOWER on IntegriCloud