NUMA-aware AllocateCommonBuffer?

I want to allocate per-processor data structures in the memory that belongs to their nodes. This memory needs to be accessible to the bus-master devices, so it has to be a common buffer. I could only find MmAllocateContiguousMemorySpecifyCacheNode function, but it won’t give the PCIe-visible physical address. Are there any other means?

MmGetPhysicalAddress will give you the address for PCIe.

Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

-----Original Message-----
From: xxxxx@broadcom.com [mailto:xxxxx@broadcom.com]
Posted At: Friday, June 11, 2010 7:35 PM
Posted To: ntdev
Conversation: NUMA-aware AllocateCommonBuffer?
Subject: NUMA-aware AllocateCommonBuffer?

I want to allocate per-processor data structures in the memory that
belongs to
their nodes. This memory needs to be accessible to the bus-master
devices, so
it has to be a common buffer. I could only find
MmAllocateContiguousMemorySpecifyCacheNode function, but it won’t give
the
PCIe-visible physical address. Are there any other means?

__________ Information from ESET Smart Security, version of virus
signature
database 5191 (20100611) __________

The message was checked by ESET Smart Security.

http://www.eset.com

>MmGetPhysicalAddress will give you the address for PCIe.

Only assuming that Microsoft guarantees that processor-visible and device-visible addresses always match. So far, such guarantee was never given, even though it holds true for now.

I think the solution could be to use KeSetSystemGroupAffinityThread to switch the current thread to different nodes, and call AllocateCommonBuffer from that context.