mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 07:13:34 +00:00
b2ca916ce3
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. Cc: Michal Hocko <mhocko@suse.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Link: https://lore.kernel.org/r/158188324802.894464.13128795207831894206.stgit@dwillia2-desk3.amr.corp.intel.com
25 lines
442 B
C
25 lines
442 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _LINUX_NUMA_H
|
|
#define _LINUX_NUMA_H
|
|
|
|
|
|
#ifdef CONFIG_NODES_SHIFT
|
|
#define NODES_SHIFT CONFIG_NODES_SHIFT
|
|
#else
|
|
#define NODES_SHIFT 0
|
|
#endif
|
|
|
|
#define MAX_NUMNODES (1 << NODES_SHIFT)
|
|
|
|
#define NUMA_NO_NODE (-1)
|
|
|
|
#ifdef CONFIG_NUMA
|
|
int numa_map_to_online_node(int node);
|
|
#else
|
|
static inline int numa_map_to_online_node(int node)
|
|
{
|
|
return NUMA_NO_NODE;
|
|
}
|
|
#endif
|
|
|
|
#endif /* _LINUX_NUMA_H */
|