linux-numa.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Rob van de Voort <rob.van.der.voort@Prodrive.nl>
Cc: linux-numa@vger.kernel.org
Subject: Re: PCIe dma-able memory location in physical memory for Intel Nehalem + Tylersburg architecture
Date: Fri, 10 Jul 2009 11:45:26 +0200	[thread overview]
Message-ID: <20090710094526.GA316@basil.fritz.box> (raw)
In-Reply-To: <4CD35CD1F8085945B597F80EEC894213030C20F9@exc01.bk.prodrive.nl>

On Fri, Jul 10, 2009 at 09:56:29AM +0200, Rob van de Voort wrote:
> 
> Hello,
> 
> I have the following question regarding the (re-)allocation of dma-able
> memory for a PCIe device. I wish to know on which CPU / Memory
> controller the dma-able memory will be allocated. 

There are several kinds of dma-able memory.

Coherent/consistent memory (pci_alloc_consistent, dma_alloc_coherent)
This is usually allocated on the node where the device is connected to,
if the platform reports it correctly using ACPI and there is enough
memory available on that node.  In some kernels there were bugs with this.

All other memory, later mapped with pci_map_*/dma_map_*: This 
is allocated according to the current numa memory policy, unless
you override it (alloc_pages_node etc.)

> The system runs a 64bit linux kernel. Furthermore a PCIe device which
> can only use 32 bit addressing is connected to the PCIe bus. I want to

GFP_DMA32 allocations are typically only on the first node, unless
your first node has less than 3GB of memory or so.

The only thing you can do for 4GB limited allocation devices is to
enable VT-d and allocate it elsewhere (alloc_pages_node et.al.)
and then let it be remapped by pci_map*/dma_map* into the first
4GB.

> P.S  I'd be grateful if people could point me in the direction of
> resources I could read. Thus far I have gone over the PCI / DMA

http://halobates.de/numaapi3.pdf has a general overview of NUMA
policy, although from the user space perspective.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

      reply	other threads:[~2009-07-10  9:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-10  7:56 PCIe dma-able memory location in physical memory for Intel Nehalem + Tylersburg architecture Rob van de Voort
2009-07-10  9:45 ` Andi Kleen [this message]

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=20090710094526.GA316@basil.fritz.box \
    --to=andi@firstfloor.org \
    --cc=linux-numa@vger.kernel.org \
    --cc=rob.van.der.voort@Prodrive.nl \
    /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).