public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: linux-kernel@vger.kernel.org
Subject: Re: Can Linux live without DMA zone?
Date: Thu, 2 Nov 2006 15:24:33 -0800	[thread overview]
Message-ID: <20061102152433.1c01faad@freekitty> (raw)
In-Reply-To: 20061102231715.GA10902@srv.junsun.net

On Thu, 2 Nov 2006 15:17:15 -0800
Jun Sun <jsun@junsun.net> wrote:

> On Thu, Nov 02, 2006 at 11:19:05PM +0100, Arjan van de Ven wrote:
> > On Thu, 2006-11-02 at 16:26 -0500, Phillip Susi wrote:
> > > Arjan van de Ven wrote:
> > > > that's for the 32 bit boundary. THe problem is that there are 31, 30, 28
> > > > and 26 bit devices as well, and those are in more trouble, and will
> > > > eventually fall back to GFP_DMA (inside the x86 PCI code; the driver
> > > > just uses the pci dma allocation routines) if they can't get suitable
> > > > memory otherwise....
> > > > 
> > > > It's all nice in theory. But then there is the reality that not all
> > > > devices are nice pci device that implement the entire spec;)
> > > > 
> > > 
> > > Right, but doesn't the bounce/allocation routine take as a parameter the 
> > > limit that the device can handle?  If the device can handle 28 bit 
> > > addresses, then the kernel should not limit it to only 24 bits.
> > 
> > you're right in theory, but the kernel only has a few pools of memory
> > available, but not at every bit boundary. there is a 32 bit pool
> > (GFP_DMA32) on some, a 30-ish bit pool (GFP_KERNEL) on others, and a 24
> > bit pool (GFP_DMA) with basically nothing inbetween.
> >
> 
> Perhaps a better solution is to 
> 
> 1. get rid of DMA zone
> 
> 2. have another alloc funciton (e.g., kmalloc_range()) which takes an
>    extra pair of parameters to indicate the desired range for the
>    allocated memory.  Most DMA buffers are allocated during start-up.
>    So the alloc operations should generally be successful.
> 

Network devices don't allocate buffer until they are brought up.
By then a lot of memory allocation has happened.  You could add an
interface that allows a device to say:
	kmalloc_range_intent(unsigned long mask, unsigned count, unsigned size)
to cause reservation before use.

-- 
Stephen Hemminger <shemminger@osdl.org>

  reply	other threads:[~2006-11-02 23:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-02  2:15 Can Linux live without DMA zone? Jun Sun
2006-11-02  9:16 ` Arjan van de Ven
2006-11-02 10:32 ` Paul Mundt
2006-11-02 16:32 ` Phillip Susi
2006-11-02 16:57   ` Arjan van de Ven
2006-11-02 19:08     ` Phillip Susi
2006-11-02 20:10       ` Arjan van de Ven
2006-11-02 21:26         ` Phillip Susi
2006-11-02 22:19           ` Arjan van de Ven
2006-11-02 23:17             ` Jun Sun
2006-11-02 23:24               ` Stephen Hemminger [this message]
2006-11-06  2:19               ` Phillip Susi
2006-11-03 17:54             ` Krzysztof Halasa
2006-11-02 18:02   ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2006-11-02  3:43 Conke Hu
2006-11-02  7:13 ` Peter Zijlstra
2006-11-02 16:13   ` Christoph Lameter
2006-11-02 10:33 Conke Hu
2006-11-02 10:51 ` Arjan van de Ven
2006-11-02 13:09 ` Alan Cox

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=20061102152433.1c01faad@freekitty \
    --to=shemminger@osdl.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox