All of lore.kernel.org
 help / color / mirror / Atom feed
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To: hancockrwd@gmail.com
Cc: konrad.wilk@oracle.com, davem@davemloft.net,
	fujita.tomonori@lab.ntt.co.jp, bzolnier@gmail.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-usb@vger.kernel.org
Subject: Re: Was: Re: [RFC PATCH] fix problems with NETIF_F_HIGHDMA in  networking, Now: SWIOTLB dynamic allocation
Date: Tue, 2 Mar 2010 13:40:57 +0900	[thread overview]
Message-ID: <20100302133758W.fujita.tomonori@lab.ntt.co.jp> (raw)
In-Reply-To: <51f3faa71003011312n3e7f8151x1a5e4b8bb57bb7c0@mail.gmail.com>

On Mon, 1 Mar 2010 15:12:41 -0600
Robert Hancock <hancockrwd@gmail.com> wrote:

> On Mon, Mar 1, 2010 at 10:34 AM, Konrad Rzeszutek Wilk
> <konrad.wilk@oracle.com> wrote:
> > On Sun, Feb 28, 2010 at 12:16:28AM -0800, David Miller wrote:
> >> From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> >> Date: Sun, 28 Feb 2010 03:38:19 +0900
> >>
> >> > When I proposed such approach (always use swiotlb) before, IIRC,
> >> > the objections were:
> >> >
> >> > - better to make allocation respect dma_mask. (I don't think that this
> >> >   approach is possible since we don't know which device handles data
> >> >   later when we allocate memory).
> >>
> >> And such objects might end up being processed by multiple devices with
> >> different DMA restrictions.
> >>
> >> > - swiotlb is not good for small systems since it allocates too much
> >> >   memory (we can fix this though).
> >>
> >> Indeed.
> >
> > What would be a good mechanism for this? Enumerating all of the PCI
> > devices to find out which ones are 32-bit and then allocate some chunk
> > of memory based on the amount of them? say, 1MB per card?
> >
> > Or maybe a simpler one - figure out how many pages we have an allocate
> > based on some sliding rule (say, 8MB for under 512MB, 16MB between 512MB
> > and 2GB, and 32MB for 2GB to 4GB, and after that the full 64MB?)
> 
> Why do we need to allocate SWIOTLB if your highest memory address is
> under 4GB? You can just disable it in that case, like x86_64 does.

Unfortunately, we need to do because the goal is removing the block
layer bounce (and other bounce mechanisms in sub systems).

For example, even if highest memory address is under 4GB, you must
provide bounce buffer for ISA devices (and some devices for strange
DMA restrictions such as under 1GB).

WARNING: multiple messages have this Message-ID (diff)
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To: hancockrwd@gmail.com
Cc: konrad.wilk@oracle.com, davem@davemloft.net,
	fujita.tomonori@lab.ntt.co.jp, bzolnier@gmail.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-usb@vger.kernel.org
Subject: Re: Was: Re: [RFC PATCH] fix problems with NETIF_F_HIGHDMA in networking, Now: SWIOTLB dynamic allocation
Date: Tue, 2 Mar 2010 13:40:57 +0900	[thread overview]
Message-ID: <20100302133758W.fujita.tomonori@lab.ntt.co.jp> (raw)
In-Reply-To: <51f3faa71003011312n3e7f8151x1a5e4b8bb57bb7c0@mail.gmail.com>

On Mon, 1 Mar 2010 15:12:41 -0600
Robert Hancock <hancockrwd@gmail.com> wrote:

> On Mon, Mar 1, 2010 at 10:34 AM, Konrad Rzeszutek Wilk
> <konrad.wilk@oracle.com> wrote:
> > On Sun, Feb 28, 2010 at 12:16:28AM -0800, David Miller wrote:
> >> From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> >> Date: Sun, 28 Feb 2010 03:38:19 +0900
> >>
> >> > When I proposed such approach (always use swiotlb) before, IIRC,
> >> > the objections were:
> >> >
> >> > - better to make allocation respect dma_mask. (I don't think that this
> >> >   approach is possible since we don't know which device handles data
> >> >   later when we allocate memory).
> >>
> >> And such objects might end up being processed by multiple devices with
> >> different DMA restrictions.
> >>
> >> > - swiotlb is not good for small systems since it allocates too much
> >> >   memory (we can fix this though).
> >>
> >> Indeed.
> >
> > What would be a good mechanism for this? Enumerating all of the PCI
> > devices to find out which ones are 32-bit and then allocate some chunk
> > of memory based on the amount of them? say, 1MB per card?
> >
> > Or maybe a simpler one - figure out how many pages we have an allocate
> > based on some sliding rule (say, 8MB for under 512MB, 16MB between 512MB
> > and 2GB, and 32MB for 2GB to 4GB, and after that the full 64MB?)
> 
> Why do we need to allocate SWIOTLB if your highest memory address is
> under 4GB? You can just disable it in that case, like x86_64 does.

Unfortunately, we need to do because the goal is removing the block
layer bounce (and other bounce mechanisms in sub systems).

For example, even if highest memory address is under 4GB, you must
provide bounce buffer for ISA devices (and some devices for strange
DMA restrictions such as under 1GB).

  reply	other threads:[~2010-03-02  4:41 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-23  2:45 [RFC PATCH] fix problems with NETIF_F_HIGHDMA in networking drivers Robert Hancock
2010-02-26  9:36 ` David Miller
2010-02-26 14:46   ` Robert Hancock
2010-02-26 14:46     ` Robert Hancock
2010-02-26 15:25     ` Bartlomiej Zolnierkiewicz
2010-02-27  3:08       ` Robert Hancock
2010-02-27  3:08         ` Robert Hancock
2010-02-27  9:53         ` David Miller
2010-02-27 11:59           ` Bartlomiej Zolnierkiewicz
2010-02-27 12:05             ` David Miller
2010-02-27 18:15               ` Robert Hancock
2010-02-27 18:15                 ` Robert Hancock
2010-02-27 18:38                 ` FUJITA Tomonori
2010-02-27 18:38                   ` FUJITA Tomonori
2010-02-28  8:16                   ` David Miller
2010-02-28  8:16                     ` David Miller
2010-03-01 16:34                     ` Was: Re: [RFC PATCH] fix problems with NETIF_F_HIGHDMA in networking, Now: SWIOTLB dynamic allocation Konrad Rzeszutek Wilk
2010-03-01 21:12                       ` Robert Hancock
2010-03-01 21:12                         ` Robert Hancock
2010-03-02  4:40                         ` FUJITA Tomonori [this message]
2010-03-02  4:40                           ` FUJITA Tomonori
2010-03-02  4:40                       ` FUJITA Tomonori
2010-02-27 17:59           ` [RFC PATCH] fix problems with NETIF_F_HIGHDMA in networking drivers Robert Hancock
2010-02-27 17:59             ` Robert Hancock
2010-02-27 18:38             ` FUJITA Tomonori
2010-02-27 18:38               ` FUJITA Tomonori

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=20100302133758W.fujita.tomonori@lab.ntt.co.jp \
    --to=fujita.tomonori@lab.ntt.co.jp \
    --cc=bzolnier@gmail.com \
    --cc=davem@davemloft.net \
    --cc=hancockrwd@gmail.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@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 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.