Skip to content

Commit 8aee122

Browse files
author
Kent Overstreet
committed
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>
1 parent 5031016 commit 8aee122

4 files changed

Lines changed: 18 additions & 31 deletions

File tree

‎drivers/md/bcache/bcache.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,6 @@ struct cached_dev {
364364
unsigned sequential_cutoff;
365365
unsigned readahead;
366366

367-
unsigned sequential_merge:1;
368367
unsigned verify:1;
369368

370369
unsigned partial_stripes_expensive:1;

‎drivers/md/bcache/request.c‎

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio)
510510
unsigned mode = cache_mode(dc, bio);
511511
unsigned sectors, congested = bch_get_congested(c);
512512
struct task_struct *task = current;
513+
struct io *i;
513514

514515
if (atomic_read(&dc->disk.detaching) ||
515516
c->gc_stats.in_use > CUTOFF_CACHE_ADD ||
@@ -536,38 +537,30 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio)
536537
(bio->bi_rw & REQ_SYNC))
537538
goto rescale;
538539

539-
if (dc->sequential_merge) {
540-
struct io *i;
540+
spin_lock(&dc->io_lock);
541541

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;
543546

544-
hlist_for_each_entry(i, iohash(dc, bio->bi_sector), hash)
545-
if (i->last == bio->bi_sector &&
546-
time_before(jiffies, i->jiffies))
547-
goto found;
547+
i = list_first_entry(&dc->io_lru, struct io, lru);
548548

549-
i = list_first_entry(&dc->io_lru, struct io, lru);
550-
551-
add_sequential(task);
552-
i->sequential = 0;
549+
add_sequential(task);
550+
i->sequential = 0;
553551
found:
554-
if (i->sequential + bio->bi_size > i->sequential)
555-
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;
552+
if (i->sequential + bio->bi_size > i->sequential)
553+
i->sequential += bio->bi_size;
560554

561-
hlist_del(&i->hash);
562-
hlist_add_head(&i->hash, iohash(dc, i->last));
563-
list_move_tail(&i->lru, &dc->io_lru);
555+
i->last = bio_end_sector(bio);
556+
i->jiffies = jiffies + msecs_to_jiffies(5000);
557+
task->sequential_io = i->sequential;
564558

565-
spin_unlock(&dc->io_lock);
566-
} else {
567-
task->sequential_io = bio->bi_size;
559+
hlist_del(&i->hash);
560+
hlist_add_head(&i->hash, iohash(dc, i->last));
561+
list_move_tail(&i->lru, &dc->io_lru);
568562

569-
add_sequential(task);
570-
}
563+
spin_unlock(&dc->io_lock);
571564

572565
sectors = max(task->sequential_io,
573566
task->sequential_io_avg) >> 9;

‎drivers/md/bcache/super.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,6 @@ static int cached_dev_init(struct cached_dev *dc, unsigned block_size)
10791079
spin_lock_init(&dc->io_lock);
10801080
bch_cache_accounting_init(&dc->accounting, &dc->disk.cl);
10811081

1082-
dc->sequential_merge = true;
10831082
dc->sequential_cutoff = 4 << 20;
10841083

10851084
for (io = dc->io; io < dc->io + RECENT_IO; io++) {

‎drivers/md/bcache/sysfs.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ rw_attribute(congested_read_threshold_us);
7272
rw_attribute(congested_write_threshold_us);
7373

7474
rw_attribute(sequential_cutoff);
75-
rw_attribute(sequential_merge);
7675
rw_attribute(data_csum);
7776
rw_attribute(cache_mode);
7877
rw_attribute(writeback_metadata);
@@ -161,7 +160,6 @@ SHOW(__bch_cached_dev)
161160
sysfs_hprint(stripe_size, dc->disk.stripe_size << 9);
162161
var_printf(partial_stripes_expensive, "%u");
163162

164-
var_printf(sequential_merge, "%i");
165163
var_hprint(sequential_cutoff);
166164
var_hprint(readahead);
167165

@@ -207,7 +205,6 @@ STORE(__cached_dev)
207205
dc->writeback_rate_p_term_inverse, 1, INT_MAX);
208206
d_strtoul(writeback_rate_d_smooth);
209207

210-
d_strtoul(sequential_merge);
211208
d_strtoi_h(sequential_cutoff);
212209
d_strtoi_h(readahead);
213210

@@ -319,7 +316,6 @@ static struct attribute *bch_cached_dev_files[] = {
319316
&sysfs_stripe_size,
320317
&sysfs_partial_stripes_expensive,
321318
&sysfs_sequential_cutoff,
322-
&sysfs_sequential_merge,
323319
&sysfs_clear_stats,
324320
&sysfs_running,
325321
&sysfs_state,

0 commit comments

Comments
 (0)