PCIe dma-able memory location in physical memory for Intel Nehalem / Tylersburg arch
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
PCIe dma-able memory location in physical memory for Intel Nehalem / Tylersburg arch
Hello,
We have the following question regarding the (re-)allocation of dma-able memory for a PCIe device. We want to know on which CPU / Memory controller the dma-able memory will be allocated. In addition we would like to know how we can control this allocation process, or how to reroute it to another CPU / Memory controller.
The system we use contains two Nehalem processors connected via intel QPI bus. Both processors have 3GB of DDR3 RAM in their memory banks. The PCIe bus is controlled by a tylersburg io hub which is also connected to the intel QPI bus
The system runs a 64bit linux kernel. Furthermore a PCIe device which can only use 32 bit addressing is connected to the PCIe bus. We want to allocate dma-able memory for this device using a driver. For maximal performance we would like to control the allocation of dma-able memory, in particular the allocation to a certain CPU / memory controller.
So our questions are:
-1- How can we know were our dma-able memory is allocated in physical memory?
-2- How can we control / redirect this allocation to a certain memory controller / CPU?
In this context CPU is the physical CPU not a logical one.
We got a bit further with the DMA allocation, we know allocate a number of blocks of 4MB to transfer the data from the device.
The device allocates the dma memory on NUMA node 0 were zone DMA and zone DMA32 (x86_64) are located.
We use pci_alloc_consistent() to allocate a number of blocks of 4MB.
Our /proc/buddyinfo displays we don't have a zone NORMAl on node0.
We have a number of processes running on the other node (node 1) which does need to acces the dma-able memory
- QUESTION: how may we shrink zone DMA32 or influence how zones are mapped, we would like to have a part of zone NORMAL at node 0.
The process that runs on the other node needs to make use of the cache to get a reasonable performance
- QUESTION: how does pci_alloc_consistent set the cache settings of the memory, will this not be cached, or does it guarantee that the cache is synced?
- QUESTION: the device only transfers data from the device to the kernel, is pci_alloc_consisten the way to go or could we better use pci_map_single to set the
direction and then use pci_dma_sync_single() to sync the cache manually.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.