All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: Split bios on chunk boundaries
@ 2015-12-22 22:48 Keith Busch
  2015-12-23  0:17 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Keith Busch @ 2015-12-22 22:48 UTC (permalink / raw)


For h/w that advertise their block storage's underlying chunk size, it's
a big performance win to not submit commands that cross them. This patch
uses that criteria if it is provided. If it is not provided, this patch
uses the max sectors as before.

Signed-off-by: Keith Busch <keith.busch at intel.com>
---
 block/blk-merge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-merge.c b/block/blk-merge.c
index 0e5643a..d05fdd2 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -83,7 +83,7 @@ static struct bio *blk_bio_segment_split(struct request_queue *q,
 	struct bio *new = NULL;
 
 	bio_for_each_segment(bv, bio, iter) {
-		if (sectors + (bv.bv_len >> 9) > queue_max_sectors(q))
+		if (sectors + (bv.bv_len >> 9) > blk_max_size_offset(q, bio->bi_iter.bi_sector))
 			goto split;
 
 		/*
-- 
2.6.2.307.g37023ba

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] block: Split bios on chunk boundaries
  2015-12-22 22:48 [PATCH] block: Split bios on chunk boundaries Keith Busch
@ 2015-12-23  0:17 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2015-12-23  0:17 UTC (permalink / raw)


On 12/22/2015 03:48 PM, Keith Busch wrote:
> For h/w that advertise their block storage's underlying chunk size, it's
> a big performance win to not submit commands that cross them. This patch
> uses that criteria if it is provided. If it is not provided, this patch
> uses the max sectors as before.
>
> Signed-off-by: Keith Busch <keith.busch at intel.com>
> ---
>   block/blk-merge.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block/blk-merge.c b/block/blk-merge.c
> index 0e5643a..d05fdd2 100644
> --- a/block/blk-merge.c
> +++ b/block/blk-merge.c
> @@ -83,7 +83,7 @@ static struct bio *blk_bio_segment_split(struct request_queue *q,
>   	struct bio *new = NULL;
>
>   	bio_for_each_segment(bv, bio, iter) {
> -		if (sectors + (bv.bv_len >> 9) > queue_max_sectors(q))
> +		if (sectors + (bv.bv_len >> 9) > blk_max_size_offset(q, bio->bi_iter.bi_sector))
>   			goto split;
>
>   		/*

Looks good, will apply. Thanks Keith!

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-23  0:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-22 22:48 [PATCH] block: Split bios on chunk boundaries Keith Busch
2015-12-23  0:17 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.