Bug 72051

Summary: Failed to correctly detect device numa_node information on AMD systems
Product: Drivers Reporter: Suravee Suthikulpanit (suravee.suthikulpanit)
Component: PCIAssignee: drivers_pci (drivers_pci)
Status: RESOLVED CODE_FIX    
Severity: normal CC: aaron.lu, bjorn
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 3.14-rc4 Subsystem:
Regression: No Bisected commit-id:
Attachments: Dump from SRAT table
Dump from SLIT table
Dump from DSDT table

Description Suravee Suthikulpanit 2014-03-14 01:23:51 UTC
This bug affects AMD family 12h and newer.

The device numa_node information in the sysfs for each PCI device (e.g.
/devices/pci0000:50/0000:50:00.2/numa_node) is showing value -1.

In file arch/x86/pci/acpi.c, in function pci_acpi_scan_root(), it is
queries the node information as following:

#ifdef CONFIG_ACPI_NUMA
      pxm = acpi_get_pxm(device->handle);
      if (pxm >= 0)
          node = pxm_to_node(pxm);
      if (node != -1)
          set_mp_bus_to_node(busnum, node);
      else
#endif
          node = get_mp_bus_to_node(busnum);

In this case, I see that the acpi_get_pxm() returns -1.  Therefore, it
falls back to using the node information in mp_bus_to_node[].  For AMD systems, the arch/x86/pci/amd_bus.c only probe the hostbridge for family10h and 11h, and showing the correct numa_node information.  For the newer systems, it does not fill the mp_bus_to_node[], and result in the value -1.

Please refer to the following email thread for more information:
http://marc.info/?l=linux-kernel&m=139405365524526&w=2
Comment 1 Suravee Suthikulpanit 2014-03-14 01:24:59 UTC
Created attachment 129331 [details]
Dump from SRAT table
Comment 2 Suravee Suthikulpanit 2014-03-14 01:25:18 UTC
Created attachment 129341 [details]
Dump from SLIT table
Comment 3 Suravee Suthikulpanit 2014-03-14 01:25:44 UTC
Created attachment 129351 [details]
Dump from DSDT table
Comment 4 Bjorn Helgaas 2014-06-03 23:49:59 UTC
Resolved by

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=94d4bb5b13978127d12860bc6b7071a784144e2f

which will appear in v3.16-rc1.