block: keep bdi->io_pages in sync with max_sectors_kb for stacked devices
Subsystems (2)
PATCH 1/1 block: keep bdi->io_pages in sync with max_sectors_kb for stacked devices
Field bdi->io_pages added in commit 9491ae4aade6 ("mm: don't cap request size based on read-ahead setting") removes unneeded split of read requests.
Stacked drivers do not call blk_queue_max_hw_sectors(). Instead they setup limits of their devices by blk_set_stacking_limits() + disk_stack_limits(). Field bio->io_pages stays zero until user set max_sectors_kb via sysfs.
This patch updates io_pages after merging limits in disk_stack_limits().
Commit c6d6e9b0f6b4 ("dm: do not allow readahead to limit IO size") fixed the same problem for device-mapper devices, this one fixes MD RAIDs.
--- block/blk-settings.c | 2 ++ 1 file changed, 2 insertions(+)
block/blk-settings.c +2 -0
@@ -664,6 +664,8 @@ void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,printk (KERN_NOTICE "%s: Warning: Device %s is misaligned\n" , top, bottom); } + + t->backing_dev_info->io_pages = t->limits.max_sectors >> (PAGE_SHIFT -9 ); }EXPORT_SYMBOL (disk_stack_limits);
Dear Konstantin,
Thank you for the patch.
Quoted 4 lines · Konstantin Khlebnikov
Field
bdi->io_pagesadded in commit9491ae4aade6("mm: don't cap request size based on read-ahead setting") removes unneeded split of read requests.Stacked drivers do not call
blk_queue_max_hw_sectors(). Instead they setup
The verb is spelled with a space *set up*.
Quoted 7 lines
limits of their devices by
blk_set_stacking_limits()+disk_stack_limits(). Fieldbio->io_pagesstays zero until user setmax_sectors_kbvia sysfs.This patch updates
io_pagesafter merging limits indisk_stack_limits().Commit
c6d6e9b0f6b4("dm: do not allow readahead to limit IO size") fixed the same problem for device-mapper devices, this one fixes MD RAIDs.
Add a Fixes: tag?
Quoted 10 lines
Signed-off-by Konstantin Khlebnikov <[email protected]>--- block/blk-settings.c | 2 ++ 1 file changed, 2 insertions(+)block/blk-settings.c +0
-0
block/blk-settings.c void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, · line 670
Quoted 7 lines
block/blk-settings.c +2
-0@@ -664,6 +664,8 @@ void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,printk (KERN_NOTICE "%s: Warning: Device %s is misaligned\n" , top, bottom); } + + t->backing_dev_info->io_pages = t->limits.max_sectors >> (PAGE_SHIFT -9 ); }EXPORT_SYMBOL (disk_stack_limits);
Kind regards,
Paul
Quoted 17 lines · Paul Menzel
Dear Konstantin,
Thank you for the patch.
Quoted 4 lines · Konstantin Khlebnikov
Field
bdi->io_pagesadded in commit9491ae4aade6("mm: don't cap request size based on read-ahead setting") removes unneeded split of read requests.Stacked drivers do not call
blk_queue_max_hw_sectors(). Instead they setupThe verb is spelled with a space *set up*.
Quoted 3 lines
limits of their devices by
blk_set_stacking_limits()+disk_stack_limits(). Fieldbio->io_pagesstays zero until user setmax_sectors_kbvia sysfs.
Quoted 8 lines
Quoted 4 lines
This patch updates
io_pagesafter merging limits indisk_stack_limits().Commit
c6d6e9b0f6b4("dm: do not allow readahead to limit IO size") fixed the same problem for device-mapper devices, this one fixes MD RAIDs.Add a Fixes: tag?
Fixes 9491ae4aade6 ("mm: don't cap request size based on read-ahead setting")
Maybe, but this isn't fatal bug. Just incomplete fix.
Same problem exists for non-disk BDIs. I.e. network filesystem must set io_pages manually if doesn't want split read requests.
Quoted 26 lines
Quoted 11 lines
Signed-off-by Konstantin Khlebnikov <[email protected]>--- block/blk-settings.c | 2 ++ 1 file changed, 2 insertions(+)block/blk-settings.c +0
-0block/blk-settings.c void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, · line 670
Quoted 7 lines
block/blk-settings.c +2
-0@@ -664,6 +664,8 @@ void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,printk (KERN_NOTICE "%s: Warning: Device %s is misaligned\n" , top, bottom); } + + t->backing_dev_info->io_pages = t->limits.max_sectors >> (PAGE_SHIFT -9 ); }EXPORT_SYMBOL (disk_stack_limits);Reviewed-by Paul Menzel <[email protected]>Kind regards,
Paul
Quoted 23 lines · Konstantin Khlebnikov
Field
bdi->io_pagesadded in commit9491ae4aade6("mm: don't cap request size based on read-ahead setting") removes unneeded split of read requests.Stacked drivers do not call
blk_queue_max_hw_sectors(). Instead they setup limits of their devices byblk_set_stacking_limits()+disk_stack_limits(). Fieldbio->io_pagesstays zero until user setmax_sectors_kbvia sysfs.This patch updates
io_pagesafter merging limits indisk_stack_limits().Commit
c6d6e9b0f6b4("dm: do not allow readahead to limit IO size") fixed the same problem for device-mapper devices, this one fixes MD RAIDs.Signed-off-by Konstantin Khlebnikov <[email protected]>--- block/blk-settings.c | 2 ++ 1 file changed, 2 insertions(+)block/blk-settings.c +0
-0
block/blk-settings.c void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, · line 671
Quoted 8 lines
block/blk-settings.c +2
-0@@ -664,6 +664,8 @@ void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,printk (KERN_NOTICE "%s: Warning: Device %s is misaligned\n" , top, bottom); } + + t->backing_dev_info->io_pages = t->limits.max_sectors >> (PAGE_SHIFT -9 ); }EXPORT_SYMBOL (disk_stack_limits);
Nitpick.. (PAGE_SHIFT - 9)
Song Liu
maintainerQuoted 35 lines · Bob Liu
Quoted 23 lines · Konstantin Khlebnikov
Field
bdi->io_pagesadded in commit9491ae4aade6("mm: don't cap request size based on read-ahead setting") removes unneeded split of read requests.Stacked drivers do not call
blk_queue_max_hw_sectors(). Instead they setup limits of their devices byblk_set_stacking_limits()+disk_stack_limits(). Fieldbio->io_pagesstays zero until user setmax_sectors_kbvia sysfs.This patch updates
io_pagesafter merging limits indisk_stack_limits().Commit
c6d6e9b0f6b4("dm: do not allow readahead to limit IO size") fixed the same problem for device-mapper devices, this one fixes MD RAIDs.Signed-off-by Konstantin Khlebnikov <[email protected]>--- block/blk-settings.c | 2 ++ 1 file changed, 2 insertions(+)block/blk-settings.c +0
-0block/blk-settings.c void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, · line 671
Quoted 8 lines
block/blk-settings.c +2
-0@@ -664,6 +664,8 @@ void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,printk (KERN_NOTICE "%s: Warning: Device %s is misaligned\n" , top, bottom); } + + t->backing_dev_info->io_pages = t->limits.max_sectors >> (PAGE_SHIFT -9 ); }EXPORT_SYMBOL (disk_stack_limits);Nitpick.. (
PAGE_SHIFT- 9)
Quoted 1 line
Reviewed-by Bob Liu <[email protected]>
Thanks for the fix. I fixed it based on the comments and applied it to md-next.
Jens, I picked the patch to md-next because md is the only user of disk_stack_limits().
Please let me know if you prefer routing it via the block tree.
Thanks,
Song
Jens Axboe
maintainerQuoted 38 lines · Song Liu
Quoted 35 lines · Bob Liu
Quoted 23 lines · Konstantin Khlebnikov
Field
bdi->io_pagesadded in commit9491ae4aade6("mm: don't cap request size based on read-ahead setting") removes unneeded split of read requests.Stacked drivers do not call
blk_queue_max_hw_sectors(). Instead they setup limits of their devices byblk_set_stacking_limits()+disk_stack_limits(). Fieldbio->io_pagesstays zero until user setmax_sectors_kbvia sysfs.This patch updates
io_pagesafter merging limits indisk_stack_limits().Commit
c6d6e9b0f6b4("dm: do not allow readahead to limit IO size") fixed the same problem for device-mapper devices, this one fixes MD RAIDs.Signed-off-by Konstantin Khlebnikov <[email protected]>--- block/blk-settings.c | 2 ++ 1 file changed, 2 insertions(+)block/blk-settings.c +0
-0block/blk-settings.c void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, · line 671
Quoted 8 lines
block/blk-settings.c +2
-0@@ -664,6 +664,8 @@ void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,printk (KERN_NOTICE "%s: Warning: Device %s is misaligned\n" , top, bottom); } + + t->backing_dev_info->io_pages = t->limits.max_sectors >> (PAGE_SHIFT -9 ); }EXPORT_SYMBOL (disk_stack_limits);Nitpick.. (
PAGE_SHIFT- 9)Quoted 1 line
Reviewed-by Bob Liu <[email protected]>
Quoted 6 lines
Thanks for the fix. I fixed it based on the comments and applied it to md-next.
Jens, I picked the patch to md-next because md is the only user of
disk_stack_limits().Please let me know if you prefer routing it via the block tree.
That's fine, thanks.
Signature · 1 line
Jens Axboe