linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Malahal Naineni <malahal@us.ibm.com>
To: Jens Axboe <jaxboe@fusionio.com>
Cc: "dm-devel@redhat.com" <dm-devel@redhat.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] block: set the bounce_pfn to the actual DMA limit rather than to max memory
Date: Fri, 24 Sep 2010 10:05:32 -0700	[thread overview]
Message-ID: <20100924170532.GA29071@us.ibm.com> (raw)
In-Reply-To: <4C9CAE68.4060706@fusionio.com>

Jens Axboe [jaxboe@fusionio.com] wrote:
> On 2010-09-22 00:22, Malahal Naineni wrote:
> > The bounce_pfn of the request queue in 64 bit systems is set to the
> > current max_low_pfn. Adding more memory later makes this incorrect.
> 
> Clearly correct.
> 
> > Memory allocated beyond this boot time max_low_pfn appear to require
> > bounce buffers (bounce buffers are actually not allocated but used in
> > calculating segments that may result in "over max segments limit"
> > errors).
> 
> But I can't quite convince myself that the change is fully correct. You
> don't really explain in your own words what the patch does, just what it
> fixes.

OK, the problem is we get "over max segments limit" errors from
blk_rq_check_limits() after adding memory. The actual bug is in
blk_phys_contig_segment() where it doesn't check for possibility of
bounce buffers. This results in merging more requests in
ll_merge_requests_fn(). Later, blk_recalc_rq_segments() call from
blk_rq_check_limits() actually uses the possibility of bounce buffers,
so the calculated number of segments exceed q's max_segments resulting
in the above error.

Fix for the actual problem is posted here:
http://permalink.gmane.org/gmane.linux.kernel.device-mapper.devel/12426

So clearly the bug should manifest only when 'bounce buffers' are
involved!  Applying the above patch indeed_fixed_ the problem, but I
know there shouldn't be any need for bounce buffers on our system, and
further investigation revealed that DMA limit is not set correctly.

This patch also _fixed_ our problem. So we are fine with either patch,
but this patch is preferred as it enables more request merges. Also,
both patches maybe needed for some configurations.

Thanks, Malahal.

  reply	other threads:[~2010-09-24 17:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-21 22:22 [PATCH] block: set the bounce_pfn to the actual DMA limit rather than to max memory Malahal Naineni
2010-09-22 23:06 ` Malahal Naineni
2010-09-24 13:58 ` Jens Axboe
2010-09-24 17:05   ` Malahal Naineni [this message]
2010-09-24 18:28     ` Jens Axboe
2010-09-24 19:20       ` Malahal Naineni
2010-09-24 19:26         ` Jens Axboe
2010-10-01  2:30           ` Malahal Naineni
2010-10-01 12:46             ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2010-09-28 22:13 Luck, Tony
2010-09-28 22:59 ` Malahal Naineni
2010-09-28 23:40   ` Luck, Tony
2010-09-29  0:42     ` Malahal Naineni
2010-09-29  4:47       ` Luck, Tony
2010-09-29  5:55         ` Malahal Naineni
2010-09-29 16:00           ` Luck, Tony

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=20100924170532.GA29071@us.ibm.com \
    --to=malahal@us.ibm.com \
    --cc=dm-devel@redhat.com \
    --cc=jaxboe@fusionio.com \
    --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;
as well as URLs for NNTP newsgroup(s).