diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-07-30 22:34:40 -0700 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-11-10 21:56:39 -0800 |
commit | 8aee122071a69ca6fa3314da7713bdf0b61dc07c (patch) | |
tree | 38d7d04c489b282bd8554caf542319fa4528f5aa /drivers/md/bcache/request.c | |
parent | 50310164bcd789eb3690f45a9baf8a507bf93358 (diff) | |
download | blackbird-op-linux-8aee122071a69ca6fa3314da7713bdf0b61dc07c.tar.gz blackbird-op-linux-8aee122071a69ca6fa3314da7713bdf0b61dc07c.zip |
bcache: Kill sequential_merge option
It never really made sense to expose this, so just kill it.
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/request.c')
-rw-r--r-- | drivers/md/bcache/request.c | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 932300f18973..f645da61189a 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -510,6 +510,7 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio) unsigned mode = cache_mode(dc, bio); unsigned sectors, congested = bch_get_congested(c); struct task_struct *task = current; + struct io *i; if (atomic_read(&dc->disk.detaching) || c->gc_stats.in_use > CUTOFF_CACHE_ADD || @@ -536,38 +537,30 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio) (bio->bi_rw & REQ_SYNC)) goto rescale; - if (dc->sequential_merge) { - struct io *i; + spin_lock(&dc->io_lock); - spin_lock(&dc->io_lock); + hlist_for_each_entry(i, iohash(dc, bio->bi_sector), hash) + if (i->last == bio->bi_sector && + time_before(jiffies, i->jiffies)) + goto found; - hlist_for_each_entry(i, iohash(dc, bio->bi_sector), hash) - if (i->last == bio->bi_sector && - time_before(jiffies, i->jiffies)) - goto found; + i = list_first_entry(&dc->io_lru, struct io, lru); - i = list_first_entry(&dc->io_lru, struct io, lru); - - add_sequential(task); - i->sequential = 0; + add_sequential(task); + i->sequential = 0; found: - if (i->sequential + bio->bi_size > i->sequential) - i->sequential += bio->bi_size; - - i->last = bio_end_sector(bio); - i->jiffies = jiffies + msecs_to_jiffies(5000); - task->sequential_io = i->sequential; + if (i->sequential + bio->bi_size > i->sequential) + i->sequential += bio->bi_size; - hlist_del(&i->hash); - hlist_add_head(&i->hash, iohash(dc, i->last)); - list_move_tail(&i->lru, &dc->io_lru); + i->last = bio_end_sector(bio); + i->jiffies = jiffies + msecs_to_jiffies(5000); + task->sequential_io = i->sequential; - spin_unlock(&dc->io_lock); - } else { - task->sequential_io = bio->bi_size; + hlist_del(&i->hash); + hlist_add_head(&i->hash, iohash(dc, i->last)); + list_move_tail(&i->lru, &dc->io_lru); - add_sequential(task); - } + spin_unlock(&dc->io_lock); sectors = max(task->sequential_io, task->sequential_io_avg) >> 9; |