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

Message ID 20191105000617.26923-1-hch@lst.de
State New
Headers show
Series
  • block: skip the split micro-optimization for devices with chunk size
Related show

Commit Message

hch@lst.de Nov. 5, 2019, 12:06 a.m. UTC
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 <hch@lst.de>
---
 block/blk-merge.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jens Axboe Nov. 5, 2019, 12:10 a.m. UTC | #1
On 11/4/19 5:06 PM, Christoph Hellwig wrote:
> 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.
Bart Van Assche Nov. 5, 2019, 12:14 a.m. UTC | #2
On 11/4/19 4:06 PM, Christoph Hellwig wrote:
> 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 <hch@lst.de>
> ---
>   block/blk-merge.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/block/blk-merge.c b/block/blk-merge.c
> index 06eb38357b41..f22cb6251d06 100644
> --- a/block/blk-merge.c
> +++ b/block/blk-merge.c
> @@ -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.

>   		 */
> -		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;
>
hch@lst.de Nov. 5, 2019, 12:18 a.m. UTC | #3
On Mon, Nov 04, 2019 at 04:14:10PM -0800, Bart Van Assche wrote:
> On 11/4/19 4:06 PM, Christoph Hellwig wrote:
>> 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 <hch@lst.de>
>> ---
>>   block/blk-merge.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/block/blk-merge.c b/block/blk-merge.c
>> index 06eb38357b41..f22cb6251d06 100644
>> --- a/block/blk-merge.c
>> +++ b/block/blk-merge.c
>> @@ -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"?

No. I did mean the loop in blk_bio_segment_split.

Patch
diff mbox series

diff --git a/block/blk-merge.c b/block/blk-merge.c
index 06eb38357b41..f22cb6251d06 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -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;