Interrupt Affinity

The affinity of an interrupt is the set of processors that can service the interrupt. Each device has an affinity policy. The operating system uses the affinity policy to compute the affinity for that device's interrupts. The affinity policy can be specified in the device's INF file or registry settings.

Starting with Windows Vista, administrators can use the registry to set an affinity policy for an interrupt.

Administrators can set the following entries under the \Interrupt Management\Affinity Policy registry key:

  • DevicePolicy is a REG_DWORD value that specifies an affinity policy. Each possible setting corresponds to a IRQ_DEVICE_POLICY value.

  • AssignmentSetOverride is a REG_BINARY value that specifies a KAFFINITY mask. If DevicePolicy is 0x04 (IrqPolicySpecifiedProcessors), then this mask specifies a set of processors to assign the device's interrupts to.

The following table lists the IRQ_DEVICE_POLICY values, and the corresponding registry setting for DevicePolicy. For more information about the meaning of each value, see IRQ_DEVICE_POLICY.

IRQ_DEVICE_POLICY valueNumeric value in registry

IrqPolicyMachineDefault

0x00

IrqPolicyAllCloseProcessors

0x01

IrqPolicyOneCloseProcessor

0x02

IrqPolicyAllProcessorsInMachine

0x03

IrqPolicySpecifiedProcessors

0x04

IrqPolicySpreadMessagesAcrossAllProcessors

0x05

 

A driver's INF file can provide default settings for the registry values. Here is an example of how to set the DevicePolicy value to IrqPolicyOneCloseProcessor in the INF file. For more information, see INF AddReg Directive.


[install-section-name.HW]
AddReg=add-registry-section 

[add-registry-section]
HKR, "Interrupt Management\Affinity Policy", DevicePolicy, 0x00010001, 2

The system makes the registry settings available to the device's driver when it sends the IRP_MN_FILTER_RESOURCE_REQUIREMENTS IRP to the driver. The operating system provides an IO_RESOURCE_DESCRIPTOR structure for each interrupt with the Type member set to CmResourceTypeInterrupt. For a message-signaled interrupt, the CM_RESOURCE_INTERRUPT_MESSAGE bit of the Flags member is set; otherwise, it is clear. The u.Interrupt member describes the settings for the interrupt.

The following table gives the correspondence between registry settings and members of u.Interrupt.

Registry ValueMember of u.Interrupt

DevicePolicy

AffinityPolicy

AssignmentSetOverride

TargetedProcessors

 

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft