[sorry ... accidentally hit reply instead of reply all ... resending to everyone] On 10/08/2014 03:25 PM, Tadeusz Struk wrote: > On 10/08/2014 12:01 PM, Prarit Bhargava wrote: >> No that isn't correct. dev_to_node() will return the node the device is >> connected to. > > include/linux/device.h: > > static inline int dev_to_node(struct device *dev) > { > return dev->numa_node; > } > > struct device { > ..... > int numa_node; /* NUMA node this device is close to */ > ... That's just bad english. The numa node value (for pci devices) is read from the ACPI tables on the system and represents the node that the pci_dev is connected to. > }; > > In case when there are two nodes and only node 0 has memory, > dev->numa_node will be 0 even though the device will be connected to the > pci root port of node 1. Your calculation completely falls apart and returns incorrect values when cpu hotplug is used or if there are multi-socket nodes (as was the case on the system that panicked), or if one uses the new cluster-on-die mode. P. -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html