]> www.infradead.org Git - users/hch/block.git/commitdiff
bcache: inherit the optimal I/O size
authorChristoph Hellwig <hch@lst.de>
Sat, 19 Sep 2020 07:31:59 +0000 (09:31 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 24 Sep 2020 06:29:17 +0000 (08:29 +0200)
Inherit the optimal I/O size setting just like the readahead window,
as any reason to do larger I/O does not apply to just readahead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Acked-by: Coly Li <colyli@suse.de>
drivers/md/bcache/super.c

index 1bbdc410ee3c515061b0272c27061bead2fff7ca..48113005ed86ad7193ab380c8c51ab9f41ca6120 100644 (file)
@@ -1430,6 +1430,8 @@ static int cached_dev_init(struct cached_dev *dc, unsigned int block_size)
        dc->disk.disk->queue->backing_dev_info->ra_pages =
                max(dc->disk.disk->queue->backing_dev_info->ra_pages,
                    q->backing_dev_info->ra_pages);
+       blk_queue_io_opt(dc->disk.disk->queue,
+               max(queue_io_opt(dc->disk.disk->queue), queue_io_opt(q)));
 
        atomic_set(&dc->io_errors, 0);
        dc->io_disable = false;