[PATCH] dm: give req_size precisely given by user
From: Jaegeuk Kim
Date: Tue Dec 18 2018 - 12:25:46 EST
This patch makes dm be aware of io_pages to assign sane req_size for reads.
Cc: stable@xxxxxxxxxxxxxxx
Cc: Jens Axboe <axboe@xxxxxxxxx>
Cc: Alasdair Kergon <agk@xxxxxxxxxx>
Cc: Mike Snitzer <snitzer@xxxxxxxxxx>
Cc: dm-devel@xxxxxxxxxx
Fixes: 9491ae4a ("mm: don't cap request size based on read-ahead setting")
Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
---
drivers/md/dm-table.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 9038c302d5c2..886790428241 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1927,6 +1927,9 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
*/
if (blk_queue_is_zoned(q))
blk_revalidate_disk_zones(t->md->disk);
+
+ /* io_pages is used for readahead */
+ q->backing_dev_info->io_pages = limits->max_sectors >> (PAGE_SHIFT - 9);
}
unsigned int dm_table_get_num_targets(struct dm_table *t)
--
2.19.0.605.g01d371f741-goog