mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
The topology setup code needs to know the total number of physical nodes enumerated in SRAT; however NUMA_EMU can cause the existing numa_nodes_parsed bitmap to be fictitious. Therefore, keep a copy of the bitmap specifically to retain the physical node count. Suggested-by: K Prateek Nayak <kprateek.nayak@amd.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Ingo Molnar <mingo@kernel.org> Tested-by: K Prateek Nayak <kprateek.nayak@amd.com> Tested-by: Zhang Rui <rui.zhang@intel.com> Tested-by: Chen Yu <yu.c.chen@intel.com> Tested-by: Kyle Meyer <kyle.meyer@hpe.com> Link: https://patch.msgid.link/20260303110059.889884023@infradead.org
71 lines
1.8 KiB
C
71 lines
1.8 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _ASM_X86_NUMA_H
|
|
#define _ASM_X86_NUMA_H
|
|
|
|
#include <linux/nodemask.h>
|
|
#include <linux/errno.h>
|
|
|
|
#include <asm/topology.h>
|
|
#include <asm/apicdef.h>
|
|
|
|
#ifdef CONFIG_NUMA
|
|
|
|
extern int numa_off;
|
|
|
|
/*
|
|
* __apicid_to_node[] stores the raw mapping between physical apicid and
|
|
* node and is used to initialize cpu_to_node mapping.
|
|
*
|
|
* The mapping may be overridden by apic->numa_cpu_node() on 32bit and thus
|
|
* should be accessed by the accessors - set_apicid_to_node() and
|
|
* numa_cpu_node().
|
|
*/
|
|
extern s16 __apicid_to_node[MAX_LOCAL_APIC];
|
|
extern nodemask_t numa_nodes_parsed __initdata;
|
|
extern nodemask_t numa_phys_nodes_parsed __initdata;
|
|
|
|
static inline void set_apicid_to_node(int apicid, s16 node)
|
|
{
|
|
__apicid_to_node[apicid] = node;
|
|
}
|
|
|
|
extern int numa_cpu_node(int cpu);
|
|
|
|
#else /* CONFIG_NUMA */
|
|
static inline void set_apicid_to_node(int apicid, s16 node)
|
|
{
|
|
}
|
|
|
|
static inline int numa_cpu_node(int cpu)
|
|
{
|
|
return NUMA_NO_NODE;
|
|
}
|
|
#endif /* CONFIG_NUMA */
|
|
|
|
#ifdef CONFIG_NUMA
|
|
extern void numa_set_node(int cpu, int node);
|
|
extern void numa_clear_node(int cpu);
|
|
extern void __init init_cpu_to_node(void);
|
|
extern void numa_add_cpu(unsigned int cpu);
|
|
extern void numa_remove_cpu(unsigned int cpu);
|
|
extern void init_gi_nodes(void);
|
|
extern int num_phys_nodes(void);
|
|
#else /* CONFIG_NUMA */
|
|
static inline void numa_set_node(int cpu, int node) { }
|
|
static inline void numa_clear_node(int cpu) { }
|
|
static inline void init_cpu_to_node(void) { }
|
|
static inline void numa_add_cpu(unsigned int cpu) { }
|
|
static inline void numa_remove_cpu(unsigned int cpu) { }
|
|
static inline void init_gi_nodes(void) { }
|
|
static inline int num_phys_nodes(void)
|
|
{
|
|
return 1;
|
|
}
|
|
#endif /* CONFIG_NUMA */
|
|
|
|
#ifdef CONFIG_DEBUG_PER_CPU_MAPS
|
|
void debug_cpumask_set_cpu(unsigned int cpu, int node, bool enable);
|
|
#endif
|
|
|
|
#endif /* _ASM_X86_NUMA_H */
|