acpi: Add acpi_map_pxm_to_online_node()
authorToshi Kani <toshi.kani@hp.com>
Fri, 19 Jun 2015 23:14:15 +0000 (17:14 -0600)
committerDan Williams <dan.j.williams@intel.com>
Fri, 26 Jun 2015 15:23:38 +0000 (11:23 -0400)
commit99759869faf15471cfce251bc138848d8af7d162
tree3146c2328644caf70051599e07bed549d1d5d953
parent581388209405902b56d055f644b4dd124a206112
acpi: Add acpi_map_pxm_to_online_node()

The kernel initializes CPU & memory's NUMA topology from ACPI
SRAT table.  Some other ACPI tables, such as NFIT and DMAR, also
contain proximity IDs for their device's NUMA topology.  This
information can be used to improve performance of these devices.

This patch introduces acpi_map_pxm_to_online_node(), which is
similar to acpi_map_pxm_to_node(), but always returns an online
node.  When the mapped node from a given proximity ID is offline,
it looks up the node distance table and returns the nearest
online node.

ACPI device drivers, which are called after the NUMA initialization
has completed in the kernel, can call this interface to obtain their
device NUMA topology from ACPI tables.  Such drivers do not have to
deal with offline nodes.  A node may be offline when a device
proximity ID is unique, SRAT memory entry does not exist, or NUMA is
disabled, ex. "numa=off" on x86.

This patch also moves the pxm range check from acpi_get_node() to
acpi_map_pxm_to_node().

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/acpi/numa.c
include/linux/acpi.h