Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1511599 > unrolled thread
| Started by | Ming Lei <tom.leiming@gmail.com> |
|---|---|
| First post | 2016-10-29 10:40 +0200 |
| Last post | 2016-11-03 00:50 +0100 |
| Articles | 7 — 4 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 09/60] dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments Ming Lei <tom.leiming@gmail.com> - 2016-10-29 10:40 +0200
Re: [PATCH 09/60] dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments Christoph Hellwig <hch@infradead.org> - 2016-10-31 16:40 +0100
Re: [PATCH 09/60] dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments Ming Lei <tom.leiming@gmail.com> - 2016-11-01 00:10 +0100
Re: [PATCH 09/60] dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments Kent Overstreet <kent.overstreet@gmail.com> - 2016-11-02 04:10 +0100
Re: [PATCH 09/60] dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments Ming Lei <tom.leiming@gmail.com> - 2016-11-02 09:00 +0100
Re: [PATCH 09/60] dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments Mike Snitzer <snitzer@redhat.com> - 2016-11-02 15:30 +0100
Re: [PATCH 09/60] dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments Ming Lei <tom.leiming@gmail.com> - 2016-11-03 00:50 +0100
| From | Ming Lei <tom.leiming@gmail.com> |
|---|---|
| Date | 2016-10-29 10:40 +0200 |
| Subject | [PATCH 09/60] dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments |
| Message-ID | <sxxlf-3Nw-9@gated-at.bofh.it> |
Avoid to access .bi_vcnt directly, because it may be not what
the driver expected any more after supporting multipage bvec.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
drivers/md/dm-rq.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c
index 1d0d2adc050a..8534cbf8ce35 100644
--- a/drivers/md/dm-rq.c
+++ b/drivers/md/dm-rq.c
@@ -819,7 +819,8 @@ static void dm_old_request_fn(struct request_queue *q)
pos = blk_rq_pos(rq);
if ((dm_old_request_peeked_before_merge_deadline(md) &&
- md_in_flight(md) && rq->bio && rq->bio->bi_vcnt == 1 &&
+ md_in_flight(md) && rq->bio &&
+ !bio_multiple_segments(rq->bio) &&
md->last_rq_pos == pos && md->last_rq_rw == rq_data_dir(rq)) ||
(ti->type->busy && ti->type->busy(ti))) {
blk_delay_queue(q, 10);
--
2.7.4
[toc] | [next] | [standalone]
| From | Christoph Hellwig <hch@infradead.org> |
|---|---|
| Date | 2016-10-31 16:40 +0100 |
| Subject | Re: [PATCH 09/60] dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments |
| Message-ID | <symQO-4eD-31@gated-at.bofh.it> |
| In reply to | #1511599 |
On Sat, Oct 29, 2016 at 04:08:08PM +0800, Ming Lei wrote: > Avoid to access .bi_vcnt directly, because it may be not what > the driver expected any more after supporting multipage bvec. > > Signed-off-by: Ming Lei <tom.leiming@gmail.com> It would be really nice to have a comment in the code why it's even checking for multiple segments.
[toc] | [prev] | [next] | [standalone]
| From | Ming Lei <tom.leiming@gmail.com> |
|---|---|
| Date | 2016-11-01 00:10 +0100 |
| Message-ID | <sytSi-uI-13@gated-at.bofh.it> |
| In reply to | #1512634 |
On Mon, Oct 31, 2016 at 11:29 PM, Christoph Hellwig <hch@infradead.org> wrote: > On Sat, Oct 29, 2016 at 04:08:08PM +0800, Ming Lei wrote: >> Avoid to access .bi_vcnt directly, because it may be not what >> the driver expected any more after supporting multipage bvec. >> >> Signed-off-by: Ming Lei <tom.leiming@gmail.com> > > It would be really nice to have a comment in the code why it's > even checking for multiple segments. > OK, will add comment about using !bio_multiple_segments(rq->bio) to replace 'rq->bio->bi_vcnt == 1'. Thanks, Ming Lei
[toc] | [prev] | [next] | [standalone]
| From | Kent Overstreet <kent.overstreet@gmail.com> |
|---|---|
| Date | 2016-11-02 04:10 +0100 |
| Subject | Re: [PATCH 09/60] dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments |
| Message-ID | <syU65-zX-11@gated-at.bofh.it> |
| In reply to | #1512634 |
On Mon, Oct 31, 2016 at 08:29:01AM -0700, Christoph Hellwig wrote: > On Sat, Oct 29, 2016 at 04:08:08PM +0800, Ming Lei wrote: > > Avoid to access .bi_vcnt directly, because it may be not what > > the driver expected any more after supporting multipage bvec. > > > > Signed-off-by: Ming Lei <tom.leiming@gmail.com> > > It would be really nice to have a comment in the code why it's > even checking for multiple segments. Or ideally refactor the code to not care about multiple segments at all.
[toc] | [prev] | [next] | [standalone]
| From | Ming Lei <tom.leiming@gmail.com> |
|---|---|
| Date | 2016-11-02 09:00 +0100 |
| Message-ID | <syYCP-3oe-19@gated-at.bofh.it> |
| In reply to | #1513631 |
On Wed, Nov 2, 2016 at 11:09 AM, Kent Overstreet <kent.overstreet@gmail.com> wrote: > On Mon, Oct 31, 2016 at 08:29:01AM -0700, Christoph Hellwig wrote: >> On Sat, Oct 29, 2016 at 04:08:08PM +0800, Ming Lei wrote: >> > Avoid to access .bi_vcnt directly, because it may be not what >> > the driver expected any more after supporting multipage bvec. >> > >> > Signed-off-by: Ming Lei <tom.leiming@gmail.com> >> >> It would be really nice to have a comment in the code why it's >> even checking for multiple segments. > > Or ideally refactor the code to not care about multiple segments at all. The check on 'bio->bi_vcnt == 1' is introduced in commit de3ec86dff160(dm: don't start current request if it would've merged with the previous), which fixed one performance issue.[1] Looks the idea of the patch is to delay dispatching the rq if it would've merged with previous request and the rq is small(single bvec). I guess the motivation is to try to increase chance of merging with the delay. But why does the code check on 'bio->bi_vcnt == 1'? Once the bio is submitted, .bi_vcnt isn't changed any more and merging doesn't change it too. So should the check have been on blk_rq_bytes(rq)? Mike, please correct me if my understanding is wrong. [1] https://www.redhat.com/archives/dm-devel/2015-March/msg00014.html thanks, Ming Lei
[toc] | [prev] | [next] | [standalone]
| From | Mike Snitzer <snitzer@redhat.com> |
|---|---|
| Date | 2016-11-02 15:30 +0100 |
| Subject | Re: [PATCH 09/60] dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments |
| Message-ID | <sz4I9-7sj-1@gated-at.bofh.it> |
| In reply to | #1513719 |
On Wed, Nov 02 2016 at 3:56am -0400, Ming Lei <tom.leiming@gmail.com> wrote: > On Wed, Nov 2, 2016 at 11:09 AM, Kent Overstreet > <kent.overstreet@gmail.com> wrote: > > On Mon, Oct 31, 2016 at 08:29:01AM -0700, Christoph Hellwig wrote: > >> On Sat, Oct 29, 2016 at 04:08:08PM +0800, Ming Lei wrote: > >> > Avoid to access .bi_vcnt directly, because it may be not what > >> > the driver expected any more after supporting multipage bvec. > >> > > >> > Signed-off-by: Ming Lei <tom.leiming@gmail.com> > >> > >> It would be really nice to have a comment in the code why it's > >> even checking for multiple segments. > > > > Or ideally refactor the code to not care about multiple segments at all. > > The check on 'bio->bi_vcnt == 1' is introduced in commit de3ec86dff160(dm: > don't start current request if it would've merged with the previous), which > fixed one performance issue.[1] > > Looks the idea of the patch is to delay dispatching the rq if it > would've merged with previous request and the rq is small(single bvec). > I guess the motivation is to try to increase chance of merging with the delay. > > But why does the code check on 'bio->bi_vcnt == 1'? Once the bio is > submitted, .bi_vcnt isn't changed any more and merging doesn't change > it too. So should the check have been on blk_rq_bytes(rq)? > > Mike, please correct me if my understanding is wrong. > > > [1] https://www.redhat.com/archives/dm-devel/2015-March/msg00014.html The patch was labored over for quite a while and is based on suggestions I got from Jens when discussing a very problematic aspect of old .request_fn request-based DM performance for a multi-threaded (64 threads) sequential IO benchmark (vdbench IIRC). The issue was reported by NetApp. The patch in question fixed the lack of merging that was seen with this interleaved sequential IO benchmark. The lack of merging was made worse if a DM multipath device had more underlying paths (e.g. 4 instead of 2). As for your question, about using blk_rq_bytes(rq) vs 'bio->bi_vcnt == 1' .. not sure how that would be a suitable replacement. But it has been a while since I've delved into these block core merge details of old .request_fn but _please_ don't change the logic of this code simply because it is proving itself to be problematic for your current patchset's cleanliness. Mike
[toc] | [prev] | [next] | [standalone]
| From | Ming Lei <tom.leiming@gmail.com> |
|---|---|
| Date | 2016-11-03 00:50 +0100 |
| Message-ID | <szds6-4tX-27@gated-at.bofh.it> |
| In reply to | #1513873 |
On Wed, Nov 2, 2016 at 10:24 PM, Mike Snitzer <snitzer@redhat.com> wrote: > On Wed, Nov 02 2016 at 3:56am -0400, > Ming Lei <tom.leiming@gmail.com> wrote: > >> On Wed, Nov 2, 2016 at 11:09 AM, Kent Overstreet >> <kent.overstreet@gmail.com> wrote: >> > On Mon, Oct 31, 2016 at 08:29:01AM -0700, Christoph Hellwig wrote: >> >> On Sat, Oct 29, 2016 at 04:08:08PM +0800, Ming Lei wrote: >> >> > Avoid to access .bi_vcnt directly, because it may be not what >> >> > the driver expected any more after supporting multipage bvec. >> >> > >> >> > Signed-off-by: Ming Lei <tom.leiming@gmail.com> >> >> >> >> It would be really nice to have a comment in the code why it's >> >> even checking for multiple segments. >> > >> > Or ideally refactor the code to not care about multiple segments at all. >> >> The check on 'bio->bi_vcnt == 1' is introduced in commit de3ec86dff160(dm: >> don't start current request if it would've merged with the previous), which >> fixed one performance issue.[1] >> >> Looks the idea of the patch is to delay dispatching the rq if it >> would've merged with previous request and the rq is small(single bvec). >> I guess the motivation is to try to increase chance of merging with the delay. >> >> But why does the code check on 'bio->bi_vcnt == 1'? Once the bio is >> submitted, .bi_vcnt isn't changed any more and merging doesn't change >> it too. So should the check have been on blk_rq_bytes(rq)? >> >> Mike, please correct me if my understanding is wrong. >> >> >> [1] https://www.redhat.com/archives/dm-devel/2015-March/msg00014.html > > The patch was labored over for quite a while and is based on suggestions I > got from Jens when discussing a very problematic aspect of old > .request_fn request-based DM performance for a multi-threaded (64 > threads) sequential IO benchmark (vdbench IIRC). The issue was reported > by NetApp. > > The patch in question fixed the lack of merging that was seen with this > interleaved sequential IO benchmark. The lack of merging was made worse > if a DM multipath device had more underlying paths (e.g. 4 instead of 2). > > As for your question, about using blk_rq_bytes(rq) vs 'bio->bi_vcnt == 1' > .. not sure how that would be a suitable replacement. But it has been a > while since I've delved into these block core merge details of old Just last year, looks not long enough, :-) > .request_fn but _please_ don't change the logic of this code simply As I explained before, neither .bi_vcnt will be changed after submitting, nor be changed during merging, so I think the checking is wrong, could you explain what is your initial motivation of checking on 'bio->bi_vcnt == 1'? > because it is proving itself to be problematic for your current > patchset's cleanliness. Could you explain what is problematic for the cleanliness? Thanks, Ming Lei
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web