block: skip the split micro-optimization for devices with chunk size
PATCH 1/1 block: skip the split micro-optimization for devices with chunk size
If the devices sets a chunk size we might have to split I/O that is smaller than a page size if it crosses the chunk boundary. Skip the micro-optimization for small I/Os in that case.
--- block/blk-merge.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
block/blk-merge.c +2 -1
@@ -317,7 +317,8 @@ void __blk_queue_split(struct request_queue *q, struct bio **bio,* are cloned, but compared to the performance impact of cloned * bios themselves the loop below doesn't matter anyway. */ -if ((*bio)->bi_vcnt ==1 && +if (!q->limits.chunk_sectors && + (*bio)->bi_vcnt ==1 && (*bio)->bi_io_vec[0 ].bv_len <=PAGE_SIZE ) { *nr_segs =1 ;break ;
Signature · 1 line
2.20.1
Jens Axboe
maintainerQuoted 3 lines · Christoph Hellwig
If the devices sets a chunk size we might have to split I/O that is smaller than a page size if it crosses the chunk boundary. Skip the micro-optimization for small I/Os in that case.
I'm just going to fold this in with the previous, which is still head of tree.
Signature · 1 line
Jens Axboe
Quoted 15 lines · Christoph Hellwig
If the devices sets a chunk size we might have to split I/O that is smaller than a page size if it crosses the chunk boundary. Skip the micro-optimization for small I/Os in that case.
Fixes b072e20f0084 ("block: merge invalidate_partitions into rescan_partitions")Signed-off-by Christoph Hellwig <[email protected]>--- block/blk-merge.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)block/blk-merge.c +0
-0
block/blk-merge.c void __blk_queue_split(struct request_queue *q, struct bio **bio, · line 318
Quoted 2 lines
block/blk-merge.c +0
-0@@ -317,7 +317,8 @@ void __blk_queue_split(struct request_queue *q, struct bio **bio,* are cloned, but compared to the performance impact of cloned * bios themselves the loop below doesn't matter anyway.
^^^^
Did you perhaps mean "test" instead of "loop"?
Thanks,
Bart.
Quoted 8 lines
block/blk-merge.c +2
-1*/ -if ((*bio)->bi_vcnt ==1 && +if (!q->limits.chunk_sectors && + (*bio)->bi_vcnt ==1 && (*bio)->bi_io_vec[0 ].bv_len <=PAGE_SIZE ) { *nr_segs =1 ;break ;
Quoted 19 lines · Bart Van Assche
Quoted 15 lines · Christoph Hellwig
If the devices sets a chunk size we might have to split I/O that is smaller than a page size if it crosses the chunk boundary. Skip the micro-optimization for small I/Os in that case.
Fixes b072e20f0084 ("block: merge invalidate_partitions into rescan_partitions")Signed-off-by Christoph Hellwig <[email protected]>--- block/blk-merge.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)block/blk-merge.c +0
-0block/blk-merge.c void __blk_queue_split(struct request_queue *q, struct bio **bio, · line 318
Quoted 2 lines
block/blk-merge.c +0
-0@@ -317,7 +317,8 @@ void __blk_queue_split(struct request_queue *q, struct bio **bio,* are cloned, but compared to the performance impact of cloned * bios themselves the loop below doesn't matter anyway. ^^^^
Quoted 1 line
Did you perhaps mean "test" instead of "loop"?
No. I did mean the loop in blk_bio_segment_split.