All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
To: Jan Beulich <jbeulich@novell.com>, Keir Fraser <keir@xensource.com>
Cc: xen-devel@lists.xensource.com, Herbert Xu <herbert@gondor.apana.org.au>
Subject: Re: x86 swiotlb questions
Date: Sat, 23 Dec 2006 09:48:44 +0000	[thread overview]
Message-ID: <C1B2ABFC.6323%Keir.Fraser@cl.cam.ac.uk> (raw)
In-Reply-To: <458C13DC.76E4.0078.0@novell.com>


Firstly, I think we should wait and see if the patches are acceptable
upstream in their current form before switching to using them.

As for dma_alloc_coherent() -- yes it makes sense to make an allocation
request with the device's specified bit width. And we could be opportunistic
about the bit width we advertise from swiotlb if we happen to get lower
memory than we asked for. *but*:
 1. Our swiotlb is made up of separately allocated strides, so the swiotlb
is not contiguous in machine memory. That needs to be kept in mind when
calculating the bit width as it'll be max over all strides.
 2. Also because of this, the existing swiotlb_dma_supported() cannot work
as is. Firstly it would need to use virt_to_machine(), and even then it
doesn't take into account that the aperture is not contiguous in machine
memory.

And as I said before, dma_bits will disappear from Xen in due course when
the dma pool goes away and is replaced with something more flexible. The
plan is to leave it (or a similarly-named parameter) in Linux, at least as a
guide to the swiotlb pre-allocation (even if no longer used for
dma_alloc_coherent).

 -- Keir

On 22/12/06 4:20 pm, "Jan Beulich" <jbeulich@novell.com> wrote:

> One more thing: Is it really necessary to restrict dma_alloc_coherent() to
> dma_bits?
> I.e., couldn't we, once the bit-level page allocator is merged, use the real
> bit width
> needed for the requesting device here? If not, this would then permit using
> the
> original implementation of swiotlb_dma_supported() (as dma_alloc_coherent()
> then
> no longer depends on dma_bits), and perhaps even auto-setting dma_bits based
> on what memory we can get out of Xen in swiotlb_init(), making the mismatching
> of
> command line options (between Xen and kernel) impossible (the kernel simply
> wouldn't have one anymore).
> 
> As a nice side effect, using the original implementation of
> swiotlb_dma_supported()
> would require slightly less tweaking of lib/swiotlb.c, hence slightly raising
> the
> chances of the changes getting accepted into mainline. And clearly, if the
> kernel
> manages to allocate the swiotlb at an address with less than dma_bits bits,
> there
> seems to be no reason to refuse use of I/O devices that the actual buffer
> fits, but
> dma_bits doesn't.

  parent reply	other threads:[~2006-12-23  9:48 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-22 16:20 x86 swiotlb questions Jan Beulich
2006-12-22 21:00 ` Herbert Xu
2006-12-23  9:48 ` Keir Fraser [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-12-30 17:32 Jan Beulich
2006-12-30 17:47 ` Keir Fraser
2007-01-02  8:39   ` Jan Beulich
2007-01-03  7:10   ` Jan Beulich
2007-01-03  9:32     ` Keir Fraser
2007-01-03 11:01       ` Jan Beulich
2006-12-22 14:49 Jan Beulich
2006-12-25  4:50 ` Muli Ben-Yehuda
2006-12-25 10:20   ` Keir Fraser
2006-12-15 12:50 Jan Beulich
2006-12-15 13:35 ` Keir Fraser
2006-12-15 13:53   ` Jan Beulich
2006-12-15 14:03     ` Keir Fraser
2006-12-15 14:17       ` Jan Beulich
2006-12-15 14:19         ` Keir Fraser
2006-12-15 14:46           ` Jan Beulich
2006-12-15 16:47             ` Keir Fraser
2006-12-15 16:19   ` Alan
2006-12-18  7:44   ` Jan Beulich
2006-12-18  9:39     ` Keir Fraser
2006-12-19 12:48       ` Jan Beulich
2006-12-19 14:14         ` Keir Fraser
2006-12-19 14:39           ` Jan Beulich
2006-12-19 14:46             ` Keir Fraser
2006-12-19 17:07               ` Muli Ben-Yehuda
2006-12-20 16:40       ` Jan Beulich

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=C1B2ABFC.6323%Keir.Fraser@cl.cam.ac.uk \
    --to=keir.fraser@cl.cam.ac.uk \
    --cc=herbert@gondor.apana.org.au \
    --cc=jbeulich@novell.com \
    --cc=keir@xensource.com \
    --cc=xen-devel@lists.xensource.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 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.