aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-07-31 01:34:40 -0400
committerKent Overstreet <kmo@daterainc.com>2013-11-11 00:56:39 -0500
commit8aee122071a69ca6fa3314da7713bdf0b61dc07c (patch)
tree38d7d04c489b282bd8554caf542319fa4528f5aa
parent50310164bcd789eb3690f45a9baf8a507bf93358 (diff)
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>
-rw-r--r--drivers/md/bcache/bcache.h1
-rw-r--r--drivers/md/bcache/request.c43
-rw-r--r--drivers/md/bcache/super.c1
-rw-r--r--drivers/md/bcache/sysfs.c4
4 files changed, 18 insertions, 31 deletions
diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
index d6970a651e42..322735547eab 100644
--- a/drivers/md/bcache/bcache.h
+++ b/drivers/md/bcache/bcache.h
@@ -364,7 +364,6 @@ struct cached_dev {
364 unsigned sequential_cutoff; 364 unsigned sequential_cutoff;
365 unsigned readahead; 365 unsigned readahead;
366 366
367 unsigned sequential_merge:1;
368 unsigned verify:1; 367 unsigned verify:1;
369 368
370 unsigned partial_stripes_expensive:1; 369 unsigned partial_stripes_expensive:1;
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)
510 unsigned mode = cache_mode(dc, bio); 510 unsigned mode = cache_mode(dc, bio);
511 unsigned sectors, congested = bch_get_congested(c); 511 unsigned sectors, congested = bch_get_congested(c);
512 struct task_struct *task = current; 512 struct task_struct *task = current;
513 struct io *i;
513 514
514 if (atomic_read(&dc->disk.detaching) || 515 if (atomic_read(&dc->disk.detaching) ||
515 c->gc_stats.in_use > CUTOFF_CACHE_ADD || 516 c->gc_stats.in_use > CUTOFF_CACHE_ADD ||
@@ -536,38 +537,30 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio)
536 (bio->bi_rw & REQ_SYNC)) 537 (bio->bi_rw & REQ_SYNC))
537 goto rescale; 538 goto rescale;
538 539
539 if (dc->sequential_merge) { 540 spin_lock(&dc->io_lock);
540 struct io *i;
541 541
542 spin_lock(&dc->io_lock); 542 hlist_for_each_entry(i, iohash(dc, bio->bi_sector), hash)
543 if (i->last == bio->bi_sector &&
544 time_before(jiffies, i->jiffies))
545 goto found;
543 546
544 hlist_for_each_entry(i, iohash(dc, bio->bi_sector), hash) 547 i = list_first_entry(&dc->io_lru, struct io, lru);
545 if (i->last == bio->bi_sector &&
546 time_before(jiffies, i->jiffies))
547 goto found;
548 548
549 i = list_first_entry(&dc->io_lru, struct io, lru); 549 add_sequential(task);
550 550 i->sequential = 0;
551 add_sequential(task);
552 i->sequential = 0;
553found: 551found:
554 if (i->sequential + bio->bi_size > i->sequential) 552 if (i->sequential + bio->bi_size > i->sequential)
555 i->sequential += bio->bi_size; 553 i->sequential += bio->bi_size;
556
557 i->last = bio_end_sector(bio);
558 i->jiffies = jiffies + msecs_to_jiffies(5000);
559 task->sequential_io = i->sequential;
560 554
561 hlist_del(&i->hash); 555 i->last = bio_end_sector(bio);
562 hlist_add_head(&i->hash, iohash(dc, i->last)); 556 i->jiffies = jiffies + msecs_to_jiffies(5000);
563 list_move_tail(&i->lru, &dc->io_lru); 557 task->sequential_io = i->sequential;
564 558
565 spin_unlock(&dc->io_lock); 559 hlist_del(&i->hash);
566 } else { 560 hlist_add_head(&i->hash, iohash(dc, i->last));
567 task->sequential_io = bio->bi_size; 561 list_move_tail(&i->lru, &dc->io_lru);
568 562
569 add_sequential(task); 563 spin_unlock(&dc->io_lock);
570 }
571 564
572 sectors = max(task->sequential_io, 565 sectors = max(task->sequential_io,
573 task->sequential_io_avg) >> 9; 566 task->sequential_io_avg) >> 9;
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index e21200e98da6..041dd9d1d882 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1079,7 +1079,6 @@ static int cached_dev_init(struct cached_dev *dc, unsigned block_size)
1079 spin_lock_init(&dc->io_lock); 1079 spin_lock_init(&dc->io_lock);
1080 bch_cache_accounting_init(&dc->accounting, &dc->disk.cl); 1080 bch_cache_accounting_init(&dc->accounting, &dc->disk.cl);
1081 1081
1082 dc->sequential_merge = true;
1083 dc->sequential_cutoff = 4 << 20; 1082 dc->sequential_cutoff = 4 << 20;
1084 1083
1085 for (io = dc->io; io < dc->io + RECENT_IO; io++) { 1084 for (io = dc->io; io < dc->io + RECENT_IO; io++) {
diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
index c5f73e34d016..4b672449ffaf 100644
--- a/drivers/md/bcache/sysfs.c
+++ b/drivers/md/bcache/sysfs.c
@@ -72,7 +72,6 @@ rw_attribute(congested_read_threshold_us);
72rw_attribute(congested_write_threshold_us); 72rw_attribute(congested_write_threshold_us);
73 73
74rw_attribute(sequential_cutoff); 74rw_attribute(sequential_cutoff);
75rw_attribute(sequential_merge);
76rw_attribute(data_csum); 75rw_attribute(data_csum);
77rw_attribute(cache_mode); 76rw_attribute(cache_mode);
78rw_attribute(writeback_metadata); 77rw_attribute(writeback_metadata);
@@ -161,7 +160,6 @@ SHOW(__bch_cached_dev)
161 sysfs_hprint(stripe_size, dc->disk.stripe_size << 9); 160 sysfs_hprint(stripe_size, dc->disk.stripe_size << 9);
162 var_printf(partial_stripes_expensive, "%u"); 161 var_printf(partial_stripes_expensive, "%u");
163 162
164 var_printf(sequential_merge, "%i");
165 var_hprint(sequential_cutoff); 163 var_hprint(sequential_cutoff);
166 var_hprint(readahead); 164 var_hprint(readahead);
167 165
@@ -207,7 +205,6 @@ STORE(__cached_dev)
207 dc->writeback_rate_p_term_inverse, 1, INT_MAX); 205 dc->writeback_rate_p_term_inverse, 1, INT_MAX);
208 d_strtoul(writeback_rate_d_smooth); 206 d_strtoul(writeback_rate_d_smooth);
209 207
210 d_strtoul(sequential_merge);
211 d_strtoi_h(sequential_cutoff); 208 d_strtoi_h(sequential_cutoff);
212 d_strtoi_h(readahead); 209 d_strtoi_h(readahead);
213 210
@@ -319,7 +316,6 @@ static struct attribute *bch_cached_dev_files[] = {
319 &sysfs_stripe_size, 316 &sysfs_stripe_size,
320 &sysfs_partial_stripes_expensive, 317 &sysfs_partial_stripes_expensive,
321 &sysfs_sequential_cutoff, 318 &sysfs_sequential_cutoff,
322 &sysfs_sequential_merge,
323 &sysfs_clear_stats, 319 &sysfs_clear_stats,
324 &sysfs_running, 320 &sysfs_running,
325 &sysfs_state, 321 &sysfs_state,