diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2016-12-08 14:41:14 -0900 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2016-12-09 18:06:02 -0900 |
commit | 51c3e021e5f0ec62c842787d6644dcb790cf39a0 (patch) | |
tree | 224df623d8f93032bf5a6c14d446625dc1f1ce44 | |
parent | 157ce8ab8c038af0b44b53de666fac28d346dc82 (diff) |
bcache: increase default journal write delay for spinning rust
-rw-r--r-- | drivers/md/bcache/super.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index ab786e81ea0b..85d8f60a3c07 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -2003,6 +2003,15 @@ static const char *cache_alloc(struct bcache_superblock *sb, if (le64_to_cpu(ca->disk_sb.sb->seq) > le64_to_cpu(c->disk_sb.seq)) cache_sb_to_cache_set(c, ca->disk_sb.sb); + /* + * Increase journal write timeout if flushes to this device are + * expensive: + */ + if (!blk_queue_nonrot(bdev_get_queue(ca->disk_sb.bdev)) && + journal_flushes_device(ca)) + c->journal.write_delay_ms = + max(c->journal.write_delay_ms, 1000U); + err = "error creating kobject"; if (c->kobj.state_in_sysfs && bch_cache_online(ca)) |