From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Nikanth Karthikesan <knikanth@suse.de>
Cc: Jens Axboe <jens.axboe@oracle.com>,
linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Subject: Re: [PATCH] BUG: nr_phys_segments cannot be less than nr_hw_segments
Date: Thu, 02 Oct 2008 10:03:33 -0500 [thread overview]
Message-ID: <1222959814.3222.5.camel@localhost.localdomain> (raw)
In-Reply-To: <200810021959.33616.knikanth@suse.de>
On Thu, 2008-10-02 at 19:59 +0530, Nikanth Karthikesan wrote:
> This is a follow-up to my earlier mail http://lkml.org/lkml/2008/9/23/294
> ([PATCH] BUG: ll_merge_requests_fn() updates req->nr_phys_segments wrongly)
>
> It is possible for the merging code to create lesser no of phys segments than
> hw segments, but every hw segment needs atleast one new phys segment. This
> triggers the BUG() on scsi_init_sgtable() as blk_rq_map_sg() returns more no
> of segments than rq->nr_phys_segments
>
> The following blktrace shows a sequence of bio's to trigger such condition on
> my machine with max_sectors_kb=512 & max_hw_sectors_kb=32767.
Um, don't you mean this the other way around? I can see this problem
occurring if the block layer gets tricked into doing a physical merge
where sector limits forbid a virtual merge.
The bug would appear to be that we sometimes only look at q->max_sectors
when deciding on mergability. Either we have to insist on max_sectors
<= hw_max_sectors, or we have to start using min(q->max_sectors,
q->max_hw_sectors) for this.
James
next prev parent reply other threads:[~2008-10-02 15:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-02 14:29 [PATCH] BUG: nr_phys_segments cannot be less than nr_hw_segments Nikanth Karthikesan
2008-10-02 15:03 ` James Bottomley [this message]
2008-10-02 16:58 ` Jens Axboe
2008-10-02 17:12 ` James Bottomley
2008-10-02 17:13 ` Jens Axboe
2008-10-03 5:28 ` Nikanth Karthikesan
2008-10-06 17:24 ` FUJITA Tomonori
2008-10-10 12:03 ` Jens Axboe
2008-10-10 12:32 ` FUJITA Tomonori
2008-10-10 12:37 ` Jens Axboe
2008-10-10 12:49 ` FUJITA Tomonori
2008-10-02 15:05 ` Nikanth Karthikesan
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=1222959814.3222.5.camel@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=jens.axboe@oracle.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox