linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: FUJITA Tomonori <tomof@acm.org>
To: benh@kernel.crashing.org
Cc: alan@redhat.com, liml@rtr.ca, jgarzik@pobox.com,
	htejun@gmail.com, James.Bottomley@HansenPartnership.com,
	linux-ide@vger.kernel.org, fujita.tomonori@lab.ntt.co.jp
Subject: Re: libata .sg_tablesize: why always dividing by 2 ?
Date: Thu, 28 Feb 2008 16:36:10 +0900	[thread overview]
Message-ID: <20080227233540B.tomof@acm.org> (raw)
In-Reply-To: <1204067976.15052.185.camel@pasglop>

On Wed, 27 Feb 2008 10:19:36 +1100
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> 
> On Tue, 2008-02-26 at 18:07 -0500, Alan Cox wrote:
> > On Wed, Feb 27, 2008 at 08:43:53AM +1100, Benjamin Herrenschmidt wrote:
> > > As I said before, it should not be fixed.
> > > If it's "fixed", we'll run out of iommu space all the time.
> > > We should stop having stupid requirements instead.
> > 
> > Hints would be extremely good. Teaching the I/O layers to do
> > 
> > 	if (blk_queue_align_64k(queue) == -EGOSTICKYOURHEADINABUCKET)
> > 		size /= 2;
> > 
> > is not very hard - or even an arch helper for
> > 
> > 	n = blk_queue_worst_case(65536, 256);
> 
> Looks like the new iommu stuff will deal with it fine by passing an
> optional boundary not-to-cross requirement down. Normal devices don't
> set that and the iommu can still pack. IDE can pass 64K and the iommu
> will align things that may cross that boundary.
> 
> That should work out fine.

Yeah, nothing changes for drivers that don't set the boundary limit.

Even for drivers setting the boundary limit, the IOMMUs just allocate
a memory area that doesn't cross the boundary. It is NOT the
size-alignment allocation that POWER IOMMU's dma_alloc_coherent does
(as discussed in this thread). So the IOMMU space doesn't run out
quickly.


I have not fixed some IOMMUs yet (as I explained at LSF). If I finish
the job, libata can remove the workaround for splitting sg lists.


> BTW. If we -still- run out of iommu space, do we have sane mechanisms
> nowadays to break things up and retry ?

About SCSI, some drivers do the right thing (retrying), some assume
that IOMMU mapping failure never happens, some just crash. I'll take
care about it after fixing the IOMMUs.

  reply	other threads:[~2008-02-28  7:38 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-26  0:02 libata .sg_tablesize: why always dividing by 2 ? Mark Lord
2008-02-26  0:15 ` Jeff Garzik
2008-02-26  0:27   ` Mark Lord
2008-02-26  0:54   ` Benjamin Herrenschmidt
2008-02-26  1:37     ` Mark Lord
2008-02-26  1:43       ` Mark Lord
2008-02-26  2:54         ` Benjamin Herrenschmidt
2008-02-26  4:38           ` Mark Lord
2008-02-26  5:30             ` Benjamin Herrenschmidt
2008-02-26  5:43               ` Mark Lord
2008-02-26  5:47                 ` Benjamin Herrenschmidt
2008-02-26 16:09                   ` James Bottomley
2008-02-26 21:43                     ` Benjamin Herrenschmidt
2008-02-26 16:25                   ` Mark Lord
2008-02-26 16:51                     ` Mark Lord
2008-02-26 21:50                       ` Benjamin Herrenschmidt
2008-02-26 21:56                         ` James Bottomley
2008-02-26 22:30                           ` Benjamin Herrenschmidt
2008-02-26 23:16                             ` Benjamin Herrenschmidt
2008-02-26 21:43                     ` Benjamin Herrenschmidt
2008-02-26 23:07                       ` Alan Cox
2008-02-26 23:19                         ` Benjamin Herrenschmidt
2008-02-28  7:36                           ` FUJITA Tomonori [this message]
2008-02-28  7:44                             ` Benjamin Herrenschmidt
2008-02-26  2:52       ` Benjamin Herrenschmidt
2008-02-26  0:22 ` Jeff Garzik
2008-02-26  0:28   ` Mark Lord

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=20080227233540B.tomof@acm.org \
    --to=tomof@acm.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=alan@redhat.com \
    --cc=benh@kernel.crashing.org \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=htejun@gmail.com \
    --cc=jgarzik@pobox.com \
    --cc=liml@rtr.ca \
    --cc=linux-ide@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).