Skip to content

Commit a00d4bf

Browse files
Christoph Hellwigaxboe
authored andcommitted
rbd: increase io_opt again
Commit 16d80c5 ("rbd: set io_min, io_opt and discard_granularity to alloc_size") lowered the io_opt size for rbd from objset_bytes which is 4MB for typical setup to alloc_size which is typically 64KB. The commit mostly talks about discard behavior and does mention io_min in passing. Reducing io_opt means reducing the readahead size, which seems counter-intuitive given that rbd currently abuses the user max_sectors setting to actually increase the I/O size. Switch back to the old setting to allow larger reads (the readahead size despite it's name actually limits the size of any buffered read) and to prepare for using io_opt in the max_sectors calculation and getting drivers out of the business of overriding the max_user_sectors value. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Ilya Dryomov <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 31ade7d commit a00d4bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/block/rbd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4955,8 +4955,8 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
49554955
struct queue_limits lim = {
49564956
.max_hw_sectors = objset_bytes >> SECTOR_SHIFT,
49574957
.max_user_sectors = objset_bytes >> SECTOR_SHIFT,
4958+
.io_opt = objset_bytes,
49584959
.io_min = rbd_dev->opts->alloc_size,
4959-
.io_opt = rbd_dev->opts->alloc_size,
49604960
.max_segments = USHRT_MAX,
49614961
.max_segment_size = UINT_MAX,
49624962
};

0 commit comments

Comments
 (0)