linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Grundler <grundler@parisc-linux.org>
To: James Bottomley <James.Bottomley@steeleye.com>
Cc: Jens Axboe <axboe@suse.de>,
	ak@suse.de, davem@redhat.com, suparna@in.ibm.com,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Alex Williamson <alex_williamson@hp.com>,
	Bjorn Helgaas <bjorn_helgaas@hp.com>
Subject: Re: [RFC] block layer support for DMA IOMMU bypass mode
Date: Tue, 1 Jul 2003 13:19:41 -0600	[thread overview]
Message-ID: <20030701191941.GF14683@dsl2.external.hp.com> (raw)
In-Reply-To: <1057077975.2135.54.camel@mulgrave>

On Tue, Jul 01, 2003 at 11:46:12AM -0500, James Bottomley wrote:
...
> However, a fair number come with
> the caveat that actually using the IOMMU is expensive.

Clarification:
IOMMU mapping is slightly more expensive than direct physical on HP boxes.
(yes davem, you've told me how wonderful sparc IOMMU is ;^)
But obviously alot less expensive than bounce buffers.

> The Problem:
> 
> At the moment, the block layer assumes segments may be virtually
> mergeable (i.e. two phsically discondiguous pages may be treated as a
> single SG entity for DMA because the IOMMU will patch up the
> discontinuity) if an IOMMU is present in the system.

The symptom is drivers which have limits on DMA entries will return
errors (or crash) when the IOMMU code doesn't actually merge as much
as the BIO code expected.

Specifically, sym53c8xx_2 only takes 96 DMA entries per IO and davidm
hit that pretty easily on ia64.
MPT/Fusion (LSI u32) doesn't seem to have a limit.
IDE limit is PAGE_SIZE/8 (or 16k/8=2k for ia64).
I haven't checked other drivers.

...
> +/* Is the queue dma_mask eligible to be bypassed */
> +#define __BIO_CAN_BYPASS(q) \
> +	((BIO_VMERGE_BYPASS_MASK) && ((q)->dma_mask & (BIO_VMERGE_BYPASS_MASK)) == (BIO_VMERGE_BYPASS_MASK))

Like Andi, I had suggested a callback into IOMMU code here.
But I'm pretty sure james proposal will work for ia64 and parisc.

Ideally, I don't like to see two seperate chunks of code performing
the "let's see what I can merge now" loops. Instead, BIO could merge
"intra-page" segments and call the IOMMU code to "merge" remaining
"inter-page" segments. IOMMU code needs to know how many physical entries
are allowed (when to stop processing) and could return the number of
sg list entries it was able to merge.

thanks james!
grant

  parent reply	other threads:[~2003-07-01 19:05 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-01 16:46 [RFC] block layer support for DMA IOMMU bypass mode James Bottomley
2003-07-01 17:09 ` Andi Kleen
2003-07-01 17:28   ` James Bottomley
2003-07-01 17:42     ` Andi Kleen
2003-07-01 19:22       ` Grant Grundler
2003-07-01 19:56       ` James Bottomley
2003-07-01 17:54     ` H. Peter Anvin
2003-07-01 19:19 ` Grant Grundler [this message]
2003-07-01 19:59   ` Alex Williamson
2003-07-01 20:11     ` James Bottomley
2003-07-01 20:03   ` James Bottomley
2003-07-01 23:01     ` Grant Grundler
2003-07-02 15:52       ` James Bottomley
2003-07-01 22:51 ` David S. Miller
2003-07-01 23:57 ` [RFC] block layer support for DMA IOMMU bypass mode II Andi Kleen
2003-07-02  0:03   ` David S. Miller
2003-07-02  0:22     ` Andi Kleen
2003-07-02  0:21       ` David S. Miller
2003-07-02 16:53       ` Grant Grundler
2003-07-02 17:19         ` Andi Kleen
2003-07-02 16:55   ` Grant Grundler
2003-07-02 17:20     ` Andi Kleen
2003-07-02 17:37       ` Grant Grundler
2003-07-02 21:16     ` Alan Cox
2003-07-02 23:56       ` Andi Kleen
2003-07-03 20:26         ` Alan Cox
2003-07-03 21:24           ` Andi Kleen
2003-07-03 22:19             ` Grant Grundler
2003-07-08  2:14             ` David S. Miller
2003-07-08 19:34               ` Andi Kleen
2003-07-08 19:47                 ` Jeff Garzik
2003-07-08 20:10                   ` Andi Kleen
2003-07-08 20:11                   ` Grant Grundler
2003-07-08 22:04                 ` David S. Miller
2003-07-08 22:25                   ` Grant Grundler
2003-07-08 22:23                     ` David S. Miller
2003-07-09 18:55                       ` Andi Kleen
2003-07-23 11:40                       ` Grant Grundler
2003-07-28 11:15                         ` Andi Kleen
2003-07-28 14:59                           ` Grant Grundler
2003-07-30  2:31                           ` Grant Grundler
2003-08-01 21:51                             ` Cliff White
2003-08-01 23:18                               ` reaim now available as osdl-aim-7 - " Cliff White
2003-07-30  4:42                           ` Grant Grundler
2003-07-30  4:51                             ` David S. Miller
2003-07-30 13:06                               ` Grant Grundler
2003-07-30 16:02                               ` Grant Grundler
2003-07-30 16:36                                 ` Andi Kleen
2003-07-30 17:18                                   ` James Bottomley
2003-07-30 14:20                             ` James Bottomley
2003-07-23 13:20                       ` Grant Grundler
2003-07-23 15:30                         ` Jens Axboe

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=20030701191941.GF14683@dsl2.external.hp.com \
    --to=grundler@parisc-linux.org \
    --cc=James.Bottomley@steeleye.com \
    --cc=ak@suse.de \
    --cc=alex_williamson@hp.com \
    --cc=axboe@suse.de \
    --cc=bjorn_helgaas@hp.com \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suparna@in.ibm.com \
    /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).