stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "block: split bios to max possible length" has been added to the 4.4-stable tree
@ 2016-02-02  1:01 gregkh
  2016-02-02  1:05 ` Keith Busch
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2016-02-02  1:01 UTC (permalink / raw)
  To: keith.busch, axboe, gregkh, kent.overstreet, tom.leiming
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    block: split bios to max possible length

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     block-split-bios-to-max-possible-length.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From e36f6204288088fda50d1c84830340ccb70f85ff Mon Sep 17 00:00:00 2001
From: Keith Busch <keith.busch@intel.com>
Date: Tue, 12 Jan 2016 15:08:39 -0700
Subject: block: split bios to max possible length

From: Keith Busch <keith.busch@intel.com>

commit e36f6204288088fda50d1c84830340ccb70f85ff upstream.

This splits bio in the middle of a vector to form the largest possible
bio at the h/w's desired alignment, and guarantees the bio being split
will have some data.

The criteria for splitting is changed from the max sectors to the h/w's
optimal sector alignment if it is provided. 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. If sector alignment is not provided,
this patch uses the max sectors as before.

This addresses the performance issue commit d380561113 attempted to
fix, but was reverted due to splitting logic error.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Cc: Jens Axboe <axboe@fb.com>
Cc: Ming Lei <tom.leiming@gmail.com>
Cc: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 block/blk-merge.c |   19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -81,9 +81,6 @@ static struct bio *blk_bio_segment_split
 	struct bio *new = NULL;
 
 	bio_for_each_segment(bv, bio, iter) {
-		if (sectors + (bv.bv_len >> 9) > queue_max_sectors(q))
-			goto split;
-
 		/*
 		 * If the queue doesn't support SG gaps and adding this
 		 * offset would create a gap, disallow it.
@@ -91,6 +88,22 @@ static struct bio *blk_bio_segment_split
 		if (bvprvp && bvec_gap_to_prev(q, bvprvp, bv.bv_offset))
 			goto split;
 
+		if (sectors + (bv.bv_len >> 9) >
+				blk_max_size_offset(q, bio->bi_iter.bi_sector)) {
+			/*
+			 * Consider this a new segment if we're splitting in
+			 * the middle of this vector.
+			 */
+			if (nsegs < queue_max_segments(q) &&
+			    sectors < blk_max_size_offset(q,
+						bio->bi_iter.bi_sector)) {
+				nsegs++;
+				sectors = blk_max_size_offset(q,
+						bio->bi_iter.bi_sector);
+			}
+			goto split;
+		}
+
 		if (bvprvp && blk_queue_cluster(q)) {
 			if (seg_size + bv.bv_len > queue_max_segment_size(q))
 				goto new_segment;


Patches currently in stable-queue which might be from keith.busch@intel.com are

queue-4.4/block-split-bios-to-max-possible-length.patch

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

* Re: Patch "block: split bios to max possible length" has been added to the 4.4-stable tree
  2016-02-02  1:01 Patch "block: split bios to max possible length" has been added to the 4.4-stable tree gregkh
@ 2016-02-02  1:05 ` Keith Busch
  2016-02-02  1:28   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Keith Busch @ 2016-02-02  1:05 UTC (permalink / raw)
  To: gregkh; +Cc: axboe, kent.overstreet, tom.leiming, stable, stable-commits

On Mon, Feb 01, 2016 at 05:01:10PM -0800, gregkh@linuxfoundation.org wrote:
> 
> This is a note to let you know that I've just added the patch titled
> 
>     block: split bios to max possible length
> 
> to the 4.4-stable tree which can be found at:
>     http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
> 
> The filename of the patch is:
>      block-split-bios-to-max-possible-length.patch
> and it can be found in the queue-4.4 subdirectory.
> 
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable@vger.kernel.org> know about it.

There turned out to be a problem with this patch on some block
formats, and we need Ming's follow up to resolve, commit-id:
d0e5fbb01a67e400e82fefe4896ea40c6447ab98

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

* Re: Patch "block: split bios to max possible length" has been added to the 4.4-stable tree
  2016-02-02  1:05 ` Keith Busch
@ 2016-02-02  1:28   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2016-02-02  1:28 UTC (permalink / raw)
  To: Keith Busch; +Cc: axboe, kent.overstreet, tom.leiming, stable, stable-commits

On Tue, Feb 02, 2016 at 01:05:50AM +0000, Keith Busch wrote:
> On Mon, Feb 01, 2016 at 05:01:10PM -0800, gregkh@linuxfoundation.org wrote:
> > 
> > This is a note to let you know that I've just added the patch titled
> > 
> >     block: split bios to max possible length
> > 
> > to the 4.4-stable tree which can be found at:
> >     http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
> > 
> > The filename of the patch is:
> >      block-split-bios-to-max-possible-length.patch
> > and it can be found in the queue-4.4 subdirectory.
> > 
> > If you, or anyone else, feels it should not be added to the stable tree,
> > please let <stable@vger.kernel.org> know about it.
> 
> There turned out to be a problem with this patch on some block
> formats, and we need Ming's follow up to resolve, commit-id:
> d0e5fbb01a67e400e82fefe4896ea40c6447ab98

Thanks, now queued up.

greg k-h

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

end of thread, other threads:[~2016-02-02  1:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-02  1:01 Patch "block: split bios to max possible length" has been added to the 4.4-stable tree gregkh
2016-02-02  1:05 ` Keith Busch
2016-02-02  1:28   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).