Skip to contentSkip to conversation

block: skip the split micro-optimization for devices with chunk size

PATCH In review Christoph Hellwig 3 participants 4 messages Nov 5, 2019 Block layer

lore
Share & tools
lore
#0 lore raw

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.

Fixes b072e20f0084 ("block: merge invalidate_partitions into rescan_partitions")
---
 block/blk-merge.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
block/blk-merge.c +2 -1
index 06eb38357b41..f22cb6251d06 100644
@@ -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
maintainer
#1 lore raw
Quoted 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
#2 lore raw
In reply to Christoph Hellwig
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")
---
  block/blk-merge.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
block/blk-merge.c +0 -0
index 06eb38357b41..f22cb6251d06 100644

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;
#3 lore raw
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")
---
  block/blk-merge.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
block/blk-merge.c +0 -0
index 06eb38357b41..f22cb6251d06 100644

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.
                                       ^^^^
Quoted 1 line

Did you perhaps mean "test" instead of "loop"?

No. I did mean the loop in blk_bio_segment_split.