From: Christoph Hellwig <hch@lst.de>
To: axboe@fb.com
Cc: ming.lei@redhat.com, linux-block@vger.kernel.org
Subject: [PATCH 3/4] block: remove the segment size check in bio_will_gap
Date: Thu, 16 May 2019 10:40:57 +0200 [thread overview]
Message-ID: <20190516084058.20678-4-hch@lst.de> (raw)
In-Reply-To: <20190516084058.20678-1-hch@lst.de>
We fundamentally do not have a maximum segement size for devices with a
virt boundary. So don't bother checking it, especially given that the
existing checks didn't properly work to start with as we never fully
update the front/back segment size and miss the bi_seg_front_size that
wuld have been required for some cases.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
---
block/blk-merge.c | 19 +------------------
1 file changed, 1 insertion(+), 18 deletions(-)
diff --git a/block/blk-merge.c b/block/blk-merge.c
index 80a5a0facb87..eee2c02c50ce 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -12,23 +12,6 @@
#include "blk.h"
-/*
- * Check if the two bvecs from two bios can be merged to one segment. If yes,
- * no need to check gap between the two bios since the 1st bio and the 1st bvec
- * in the 2nd bio can be handled in one segment.
- */
-static inline bool bios_segs_mergeable(struct request_queue *q,
- struct bio *prev, struct bio_vec *prev_last_bv,
- struct bio_vec *next_first_bv)
-{
- if (!biovec_phys_mergeable(q, prev_last_bv, next_first_bv))
- return false;
- if (prev->bi_seg_back_size + next_first_bv->bv_len >
- queue_max_segment_size(q))
- return false;
- return true;
-}
-
static inline bool bio_will_gap(struct request_queue *q,
struct request *prev_rq, struct bio *prev, struct bio *next)
{
@@ -60,7 +43,7 @@ static inline bool bio_will_gap(struct request_queue *q,
*/
bio_get_last_bvec(prev, &pb);
bio_get_first_bvec(next, &nb);
- if (bios_segs_mergeable(q, prev, &pb, &nb))
+ if (biovec_phys_mergeable(q, &pb, &nb))
return false;
return __bvec_gap_to_prev(q, &pb, nb.bv_offset);
}
--
2.20.1
next prev parent reply other threads:[~2019-05-16 8:41 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-16 8:40 fix nr_phys_segments vs iterators accounting v2 Christoph Hellwig
2019-05-16 8:40 ` [PATCH 1/4] block: don't decrement nr_phys_segments for physically contigous segments Christoph Hellwig
2019-05-16 8:48 ` Hannes Reinecke
2019-05-16 13:17 ` Ming Lei
2019-05-17 23:02 ` Ming Lei
2019-05-20 11:11 ` Christoph Hellwig
2019-05-21 1:04 ` Ming Lei
2019-05-16 8:40 ` [PATCH 2/4] block: force an unlimited segment size on queues with a virt boundary Christoph Hellwig
2019-05-16 8:49 ` Hannes Reinecke
2019-05-16 8:40 ` Christoph Hellwig [this message]
2019-05-16 8:49 ` [PATCH 3/4] block: remove the segment size check in bio_will_gap Hannes Reinecke
2019-05-16 8:40 ` [PATCH 4/4] block: remove the bi_seg_{front,back}_size fields in struct bio Christoph Hellwig
2019-05-16 8:50 ` Hannes Reinecke
2019-05-20 11:17 ` fix nr_phys_segments vs iterators accounting v2 Christoph Hellwig
2019-05-21 1:09 ` Jens Axboe
2019-05-21 1:17 ` Ming Lei
2019-05-21 1:20 ` Jens Axboe
2019-05-21 1:29 ` Ming Lei
2019-05-21 5:11 ` Christoph Hellwig
2019-05-21 7:01 fix nr_phys_segments vs iterators accounting v3 Christoph Hellwig
2019-05-21 7:01 ` [PATCH 3/4] block: remove the segment size check in bio_will_gap Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190516084058.20678-4-hch@lst.de \
--to=hch@lst.de \
--cc=axboe@fb.com \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).