mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-21 13:33:24 +07:00
ef78e5ec92
The numa_slit variable used by node_distance is available to a module as long as it is linked at compile-time. However, it is not available to loadable modules. Leading to errors such as: ERROR: "numa_slit" [drivers/nvme/host/nvme-core.ko] undefined! The error above is caused by the nvme multipath code that makes use of node_distance for its path calculation. When the patch was added, the lightnvm subsystem would select nvme and always compile it in, leading to the node_distance call to always succeed. However, when this requirement was removed, nvme could be compiled in as a module, which exposed this bug. This patch extracts node_distance to a function and exports it. Since ACPI is depending on node_distance being a simple lookup to numa_slit, the previous behavior is exposed as slit_distance and its users updated. Fixes:f333444708
"nvme: take node locality into account when selecting a path" Fixes:73569e1103
"lightnvm: remove dependencies on BLK_DEV_NVME and PCI" Signed-off-by: Matias Bjøring <mb@lightnvm.io> Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
84 lines
2.3 KiB
C
84 lines
2.3 KiB
C
/*
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
* for more details.
|
|
*
|
|
* This file contains NUMA specific prototypes and definitions.
|
|
*
|
|
* 2002/08/05 Erich Focht <efocht@ess.nec.de>
|
|
*
|
|
*/
|
|
#ifndef _ASM_IA64_NUMA_H
|
|
#define _ASM_IA64_NUMA_H
|
|
|
|
|
|
#ifdef CONFIG_NUMA
|
|
|
|
#include <linux/cache.h>
|
|
#include <linux/cpumask.h>
|
|
#include <linux/numa.h>
|
|
#include <linux/smp.h>
|
|
#include <linux/threads.h>
|
|
|
|
#include <asm/mmzone.h>
|
|
|
|
extern u16 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
|
|
extern cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
|
|
extern pg_data_t *pgdat_list[MAX_NUMNODES];
|
|
|
|
/* Stuff below this line could be architecture independent */
|
|
|
|
extern int num_node_memblks; /* total number of memory chunks */
|
|
|
|
/*
|
|
* List of node memory chunks. Filled when parsing SRAT table to
|
|
* obtain information about memory nodes.
|
|
*/
|
|
|
|
struct node_memblk_s {
|
|
unsigned long start_paddr;
|
|
unsigned long size;
|
|
int nid; /* which logical node contains this chunk? */
|
|
int bank; /* which mem bank on this node */
|
|
};
|
|
|
|
struct node_cpuid_s {
|
|
u16 phys_id; /* id << 8 | eid */
|
|
int nid; /* logical node containing this CPU */
|
|
};
|
|
|
|
extern struct node_memblk_s node_memblk[NR_NODE_MEMBLKS];
|
|
extern struct node_cpuid_s node_cpuid[NR_CPUS];
|
|
|
|
/*
|
|
* ACPI 2.0 SLIT (System Locality Information Table)
|
|
* http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf
|
|
*
|
|
* This is a matrix with "distances" between nodes, they should be
|
|
* proportional to the memory access latency ratios.
|
|
*/
|
|
|
|
extern u8 numa_slit[MAX_NUMNODES * MAX_NUMNODES];
|
|
#define slit_distance(from,to) (numa_slit[(from) * MAX_NUMNODES + (to)])
|
|
extern int __node_distance(int from, int to);
|
|
#define node_distance(from,to) __node_distance(from, to)
|
|
|
|
extern int paddr_to_nid(unsigned long paddr);
|
|
|
|
#define local_nodeid (cpu_to_node_map[smp_processor_id()])
|
|
|
|
#define numa_off 0
|
|
|
|
extern void map_cpu_to_node(int cpu, int nid);
|
|
extern void unmap_cpu_from_node(int cpu, int nid);
|
|
extern void numa_clear_node(int cpu);
|
|
|
|
#else /* !CONFIG_NUMA */
|
|
#define map_cpu_to_node(cpu, nid) do{}while(0)
|
|
#define unmap_cpu_from_node(cpu, nid) do{}while(0)
|
|
#define paddr_to_nid(addr) 0
|
|
#define numa_clear_node(cpu) do { } while (0)
|
|
#endif /* CONFIG_NUMA */
|
|
|
|
#endif /* _ASM_IA64_NUMA_H */
|