From: Jens Axboe <jens.axboe@oracle.com>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
James.Bottomley@HansenPartnership.com, knikanth@suse.de
Subject: Re: [PATCH] block: fix nr_phys_segments miscalculation bug
Date: Sat, 11 Oct 2008 09:04:03 +0200 [thread overview]
Message-ID: <20081011070402.GN19428@kernel.dk> (raw)
In-Reply-To: <20081011153048E.fujita.tomonori@lab.ntt.co.jp>
On Sat, Oct 11 2008, FUJITA Tomonori wrote:
> This is against the latest git (b922df7383749a1c0b7ea64c50fa839263d3816b).
>
> =
> From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> Subject: [PATCH] block: fix nr_phys_segments miscalculation bug
>
> This fixes the bug reported by Nikanth Karthikesan <knikanth@suse.de>:
>
> http://lkml.org/lkml/2008/10/2/203
>
> The root cause of the bug is that blk_phys_contig_segment
> miscalculates q->max_segment_size.
>
> blk_phys_contig_segment checks:
>
> req->biotail->bi_size + next_req->bio->bi_size > q->max_segment_size
>
> But blk_recalc_rq_segments might expect that req->biotail and the
> previous bio in the req are supposed be merged into one
> segment. blk_recalc_rq_segments might also expect that next_req->bio
> and the next bio in the next_req are supposed be merged into one
> segment. In such case, we merge two requests that can't be merged
> here. Later, blk_rq_map_sg gives more segments than it should.
>
> We need to keep track of segment size in blk_recalc_rq_segments and
> use it to see if two requests can be merged. This patch implements it
> in the similar way that we used to do for hw merging (virtual
> merging).
This looks really good, just like I imagined. I'll give it a fuller
review later today and do a bit of targetted testing, if it goes as
planned it'll go in soonish. Thanks a lot!
--
Jens Axboe
next prev parent reply other threads:[~2008-10-11 7:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-11 6:31 [PATCH] block: fix nr_phys_segments miscalculation bug FUJITA Tomonori
2008-10-11 7:04 ` Jens Axboe [this message]
2008-10-11 8:01 ` FUJITA Tomonori
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=20081011070402.GN19428@kernel.dk \
--to=jens.axboe@oracle.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=knikanth@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/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 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.