All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>,
	"Adam J. Richter" <adam@yggdrasil.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC] generic device DMA implementation
Date: Thu, 5 Dec 2002 17:04:58 +1100	[thread overview]
Message-ID: <20021205060458.GF1500@zax.zax> (raw)
In-Reply-To: <20021205034131.GA26616@gtf.org>

On Wed, Dec 04, 2002 at 10:41:31PM -0500, Jeff Garzik wrote:
> On Thu, Dec 05, 2002 at 01:38:47PM +1100, David Gibson wrote:
> > It seems the "try to get consistent memory, but otherwise give me
> > inconsistent" is only useful on machines which:
> > 	(1) Are not fully consisent, BUT
> > 	(2) Can get consistent memory without disabling the cache, BUT
> > 	(3) Not very much of it, so you might run out.
> > 
> > The point is, there has to be an advantage to using consistent memory
> > if it is available AND the possibility of it not being available.
> 
> Agreed here.  Add to this
> 
> (4) quite silly from an API taste perspective.
> 
> 
> > Otherwise, drivers which absolutely need consistent memory, no matter
> > the cost, should use consistent_alloc(), all other drivers just use
> > kmalloc() (or whatever) then use the DMA flushing functions which
> > compile to NOPs on platforms with consistent memory.
> 
> Ug.  This is travelling backwards in time.
> 
> kmalloc is not intended to allocate memory for DMA'ing.  I (and others)
> didn't spend all that time converting drivers to the PCI DMA API just to
> see all that work undone.

But if there aren't any consistency constraints on the memory, why not
get it with kmalloc().  There are two approaches to handling DMA on a
not-fully-consistent machine:
	1) Allocate the memory specially so that it is consistent
	2) Use any old memory, and make sure we have explicit cache
frobbing.

We have to have both: some hardware requires approach (1), and the
structure of the kernel often requires (2) to avoid lots of copying
(e.g. a network device doesn't allocate its own skbs to transmit, so
it can't assume the memory has any special consistency properties).

Since in case (2), we can't make assumptions about where the memory
came from, it might as well come from kmalloc() (or a slab, or
get_free_pages() or whatever).

-- 
David Gibson			| For every complex problem there is a
david@gibson.dropbear.id.au	| solution which is simple, neat and
				| wrong.
http://www.ozlabs.org/people/dgibson

  reply	other threads:[~2002-12-05  5:58 UTC|newest]

Thread overview: 147+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-04 17:47 [RFC] generic device DMA implementation James Bottomley
2002-12-04 18:27 ` Jeff Garzik
2002-12-04 19:36   ` James Bottomley
2002-12-04 21:19 ` Miles Bader
2002-12-04 21:21 ` Miles Bader
2002-12-04 21:42   ` James Bottomley
2002-12-05  5:44     ` Miles Bader
2002-12-04 21:46   ` James Bottomley
2002-12-05  2:31     ` Miles Bader
2002-12-05  3:06       ` James Bottomley
2002-12-05  5:02       ` David Gibson
2002-12-05 11:15     ` Benjamin Herrenschmidt
2002-12-05 11:16       ` William Lee Irwin III
2002-12-05 15:12       ` James Bottomley
2002-12-05  0:47 ` David Gibson
2002-12-05  0:54   ` Jeff Garzik
2002-12-05  1:44   ` James Bottomley
2002-12-05  2:38     ` David Gibson
2002-12-05  3:13       ` James Bottomley
2002-12-05  5:05         ` David Gibson
2002-12-05 15:03           ` James Bottomley
2002-12-05 23:54             ` David Gibson
2002-12-05  3:17       ` Miles Bader
2002-12-05  6:06         ` David Gibson
2002-12-05  6:43           ` Miles Bader
2002-12-05 23:44             ` David Gibson
2002-12-06  2:23               ` Miles Bader
2002-12-05  3:41       ` Jeff Garzik
2002-12-05  6:04         ` David Gibson [this message]
2002-12-05 16:29           ` Jeff Garzik
2002-12-05 23:59             ` David Gibson
2002-12-05 11:08   ` Benjamin Herrenschmidt
2002-12-05 11:35     ` Russell King
2002-12-05 15:24       ` James Bottomley
2002-12-06  0:01     ` David Gibson
  -- strict thread matches above, loose matches on Subject: below --
2002-12-18  3:01 [RFT][PATCH] " James Bottomley
2002-12-18  3:13 ` David Mosberger
2002-12-28 18:14 ` Russell King
2002-12-28 18:19   ` James Bottomley
2002-12-07 14:37 [RFC] " Adam J. Richter
2002-12-07  4:12 Adam J. Richter
2002-12-06 22:52 Adam J. Richter
2002-12-06 22:17 Adam J. Richter
2002-12-06 22:26 ` James Bottomley
2002-12-06 22:29   ` David S. Miller
2002-12-06 22:48     ` James Bottomley
2002-12-06 22:49       ` David S. Miller
2002-12-06 22:32   ` Arjan van de Ven
2002-12-06 17:39 Adam J. Richter
2002-12-06 18:07 ` Matthew Wilcox
2002-12-06 17:07 Adam J. Richter
2002-12-06 16:48 James Bottomley
2002-12-06 16:19 Adam J. Richter
2002-12-06 16:40 ` Matthew Wilcox
2002-12-06 18:17 ` David S. Miller
2002-12-06 18:29   ` James Bottomley
2002-12-06 18:31     ` David S. Miller
2002-12-06 18:40       ` James Bottomley
2002-12-06 18:42         ` David S. Miller
2002-12-06 21:04           ` Oliver Xymoron
2002-12-07 10:19       ` David Gibson
2002-12-06 18:36   ` Matthew Wilcox
2002-12-06 18:38     ` David S. Miller
2002-12-06  7:41 Adam J. Richter
2002-12-06 15:50 ` David S. Miller
2002-12-06  7:14 Adam J. Richter
2002-12-06 16:26 ` James Bottomley
2002-12-06 17:48   ` Miles Bader
2002-12-07  9:56   ` David Gibson
2002-12-07  9:45 ` David Gibson
2002-12-07 11:26   ` Russell King
2002-12-08  5:28     ` David Gibson
2002-12-06  6:15 David Brownell
2002-12-06  2:08 Adam J. Richter
2002-12-06  2:53 ` David Gibson
2002-12-06  4:03   ` David S. Miller
2002-12-05 20:27 Adam J. Richter
2002-12-05 17:49 Manfred Spraul
2002-12-06  0:08 ` David Gibson
2002-12-05 12:21 Adam J. Richter
2002-12-05 12:44 ` Russell King
2002-12-05 12:13 Adam J. Richter
2002-12-05 11:57 Adam J. Richter
2002-12-06  0:06 ` David Gibson
2002-12-05  5:20 Adam J. Richter
2002-12-05  3:02 Adam J. Richter
2002-12-05  6:15 ` David Gibson
2002-12-05  1:21 Adam J. Richter
2002-12-05  2:40 ` David Gibson
2002-12-05  2:49   ` Miles Bader
2002-12-05  6:12     ` David Gibson
2002-12-05  0:43 Adam J. Richter
2002-12-05  0:55 ` Jeff Garzik
2002-12-05  2:02 ` James Bottomley
2002-11-09  4:51 [parisc-linux] Untested port of parisc_device to generic device interface Adam J. Richter
2002-11-09  5:21 ` Matthew Wilcox
2002-11-09  5:21 ` Matthew Wilcox
2002-11-09  6:03   ` Greg KH
2002-11-09 15:33     ` J.E.J. Bottomley
2002-11-09 15:33     ` J.E.J. Bottomley
2002-11-09 15:33       ` J.E.J. Bottomley
2002-11-13  6:13       ` Greg KH
2002-11-13  7:46         ` Miles Bader
2002-11-13  7:46         ` Miles Bader
2002-11-13  7:52           ` Greg KH
2002-11-13  7:52           ` Greg KH
2002-11-13  8:02             ` Miles Bader
2002-11-13  8:02             ` Miles Bader
2002-11-13  8:10               ` Greg KH
2002-11-13  8:10               ` Greg KH
2002-11-13  8:26                 ` Miles Bader
2002-11-13  8:26                 ` Miles Bader
2002-11-13  8:25                   ` Greg KH
2002-11-13  8:25                   ` Greg KH
2002-11-13  9:05                     ` Miles Bader
2002-11-13  9:05                     ` Miles Bader
2002-11-13 20:13               ` Grant Grundler
2002-11-13 20:21                 ` J.E.J. Bottomley
2002-11-13 20:21                   ` J.E.J. Bottomley
2002-11-13 20:37                   ` Grant Grundler
2002-11-13 20:37                   ` Grant Grundler
2002-11-13 20:21                 ` J.E.J. Bottomley
2002-11-13 20:13               ` Grant Grundler
2002-11-13 11:59             ` Ivan Kokshaysky
2002-11-13 11:59             ` Ivan Kokshaysky
2002-11-13 12:36               ` Marc Zyngier
2002-11-13 12:36               ` Marc Zyngier
2002-11-13 16:32             ` Bjorn Helgaas
2002-11-13 16:32             ` Bjorn Helgaas
2002-11-13 17:23               ` J.E.J. Bottomley
2002-11-13 17:23                 ` J.E.J. Bottomley
2002-11-13 20:33                 ` Grant Grundler
2002-11-13 20:33                 ` Grant Grundler
2002-11-13 20:44                   ` J.E.J. Bottomley
2002-11-13 20:44                     ` J.E.J. Bottomley
2002-11-13 21:42                     ` Grant Grundler
2002-11-13 21:42                     ` Grant Grundler
2002-11-13 20:44                   ` J.E.J. Bottomley
2002-11-13 17:23               ` J.E.J. Bottomley
2002-11-13 20:12             ` Grant Grundler
2002-11-13 20:12             ` Grant Grundler
2002-11-13  6:13       ` Greg KH
2002-11-09  6:03   ` Greg KH
2002-11-09  7:58   ` Marc Zyngier
2002-11-09  7:58   ` Marc Zyngier
2002-11-09 18:04 ` Grant Grundler
2002-11-09 18:04 ` Grant Grundler

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=20021205060458.GF1500@zax.zax \
    --to=david@gibson.dropbear.id.au \
    --cc=James.Bottomley@steeleye.com \
    --cc=adam@yggdrasil.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@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.