History

ACPI: NUMA: Up-level "map to online node" functionality

The acpi_map_pxm_to_online_node() helper is used to find the closest online node to a given proximity domain. This is used to map devices in a proximity domain with no online memory or cpus to the closest online node and populate a device's 'numa_node' property. The numa_node property allows applications to be migrated "close" to a resource. In preparation for providing a generic facility to optionally map an address range to its closest online node, or the node the range would represent were it to be onlined (target_node), up-level the core of acpi_map_pxm_to_online_node() to a generic mm/numa helper.

Dan Williams committed 6 years ago

Commit b2ca9161 parent bb6d3fb4 files · +61 −42Browse files

Showing the changes to include/linux (2 of 4 files). Show all

Unified · Split

2 files
  1. include/linux/acpi.h +22 −1
  2. include/linux/numa.h +9 −0
include/linux/acpi.h+22−1
@@ -416,9 +416,30 @@ extern void acpi_osi_setup(char *str); · 415 unmodified lines
416416 extern bool acpi_osi_is_win8(void);
417417
418418 #ifdef CONFIG_ACPI_NUMA
419−int acpi_map_pxm_to_online_node(int pxm);
420419 int acpi_map_pxm_to_node(int pxm);
421420 int acpi_get_node(acpi_handle handle);
421+
422+/**
423+ * acpi_map_pxm_to_online_node - Map proximity ID to online node
424+ * @pxm: ACPI proximity ID
425+ *
426+ * This is similar to acpi_map_pxm_to_node(), but always returns an online
427+ * node. When the mapped node from a given proximity ID is offline, it
428+ * looks up the node distance table and returns the nearest online node.
429+ *
430+ * ACPI device drivers, which are called after the NUMA initialization has
431+ * completed in the kernel, can call this interface to obtain their device
432+ * NUMA topology from ACPI tables. Such drivers do not have to deal with
433+ * offline nodes. A node may be offline when a device proximity ID is
434+ * unique, SRAT memory entry does not exist, or NUMA is disabled, ex.
435+ * "numa=off" on x86.
436+ */
437+static inline int acpi_map_pxm_to_online_node(int pxm)
438+{
439+ int node = acpi_map_pxm_to_node(pxm);
440+
441+ return numa_map_to_online_node(node);
442+}
422443 #else
423444 static inline int acpi_map_pxm_to_online_node(int pxm)
424445 {
include/linux/numa.h+9−0
@@ -13,4 +13,13 @@ · 12 unmodified lines
1313
1414 #define NUMA_NO_NODE (-1)
1515
16+#ifdef CONFIG_NUMA
17+int numa_map_to_online_node(int node);
18+#else
19+static inline int numa_map_to_online_node(int node)
20+{
21+ return NUMA_NO_NODE;
22+}
23+#endif
24+
1625 #endif /* _LINUX_NUMA_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t