Is there any way in a Windows app to get the Group, NUMA Node and
Affinity of hardware devices in the system? I’d like to match a the
affinity of a process to the specific hardware which it is using.
((&->
Is there any way in a Windows app to get the Group, NUMA Node and
Affinity of hardware devices in the system? I’d like to match a the
affinity of a process to the specific hardware which it is using.
((&->
On 1/4/2011 5:55 PM, QuasiCodo wrote:
Is there any way in a Windows app to get the Group, NUMA Node and
Affinity of hardware devices in the system? I’d like to match a the
affinity of a process to the specific hardware which it is using.((&->
Looks like GetNumaNodeNumberFromHandle() might be what I need.
((&->
the only 2 things that are really affinitized in a driver are DPCs and interrupts. Typically affinitization only happens in network and storage drivers. GetNumaNodeNumberFromHandle will work for a handle to a storage device or i think even a socket, but that is about it. for a random driver, this won’t work
d
Doron answered your question, but I’d like to comment on it.
I’ve almost never seen a situation where you need to know which NUMA node
the device is in. In fact, in the vast majority of machines built today (in
contrast to those built seven or eight years ago) devices tend to be in
their own node, with all of the processor/memory nodes equally far from all
the devices. This is true for any machine where the NUMA nodes are defined
by a “socket” with a set of processor cores and a memory controller.
Machines where the NUMA nodes are defined by having multiple “chassis,” each
with their own set of processors, memory and devices, have always been a
high-end specialty item. The vast majority of datacenters are populated
with two- to four-socket single-chassis machines where I/O devices have no
special affinity.
With all that said, regardless of what type of machine you’re targeting, the
device’s node is almost never important. You’ll get I/O requests from
almost every processor unless you customize your application to run on a
subset of processors. And if you do have control of your application and
you do customize it and you also happen to be running on a multi-chassis
machine, then you’ll be vastly underusing your high-end expensive server.
And lastly and most importantly, you generally get all the useful benefit of
NUMA awareness by doing one thing: Use MSI-X to generate multiple
interrupts from your device. Then affinitize those messages with processors
and use that to interrupt the processor that initiated each I/O. Then the
processor that’s near the data (and might even have it in cache) will handle
the interrupt and complete the I/O.
If your device is for networking, NDIS facilitates the strategy described in
the previous paragraph through two mechanisms, called RSS and VMQ. If your
device is for storage, storport facilitates it with a mechanism called “NUMA
I/O.” If your device is neither, then you have to build your own
infrastructure.
Jake Oshins
Hyper-V I/O Architect
Windows Kernel Group
This post implies no warranties and confers no rights.
wrote in message news:xxxxx@ntdev…
the only 2 things that are really affinitized in a driver are DPCs and
interrupts. Typically affinitization only happens in network and storage
drivers. GetNumaNodeNumberFromHandle will work for a handle to a storage
device or i think even a socket, but that is about it. for a random driver,
this won’t work
d