mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-29 07:34:06 +08:00
645a79195f
Unlike 64bit, 32bit has been using its own cpu_to_node_map[] for CPU -> NUMA node mapping. Replace it with early_percpu variable x86_cpu_to_node_map and share the mapping code with 64bit. * USE_PERCPU_NUMA_NODE_ID is now enabled for 32bit too. * x86_cpu_to_node_map and numa_set/clear_node() are moved from numa_64 to numa. For now, on 32bit, x86_cpu_to_node_map is initialized with 0 instead of NUMA_NO_NODE. This is to avoid introducing unexpected behavior change and will be updated once init path is unified. * srat_detect_node() is now enabled for x86_32 too. It calls numa_set_node() and initializes the mapping making explicit cpu_to_node_map[] updates from map/unmap_cpu_to_node() unnecessary. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: eric.dumazet@gmail.com Cc: yinghai@kernel.org Cc: brgerst@gmail.com Cc: gorcunov@gmail.com Cc: penberg@kernel.org Cc: shaohui.zheng@intel.com Cc: rientjes@google.com LKML-Reference: <1295789862-25482-15-git-send-email-tj@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Cc: David Rientjes <rientjes@google.com>
49 lines
1.3 KiB
C
49 lines
1.3 KiB
C
#ifndef _ASM_X86_NUMA_64_H
|
|
#define _ASM_X86_NUMA_64_H
|
|
|
|
#include <linux/nodemask.h>
|
|
|
|
struct bootnode {
|
|
u64 start;
|
|
u64 end;
|
|
};
|
|
|
|
extern int compute_hash_shift(struct bootnode *nodes, int numblks,
|
|
int *nodeids);
|
|
|
|
#define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT))
|
|
|
|
extern void numa_init_array(void);
|
|
extern int numa_off;
|
|
|
|
extern unsigned long numa_free_all_bootmem(void);
|
|
extern void setup_node_bootmem(int nodeid, unsigned long start,
|
|
unsigned long end);
|
|
|
|
#ifdef CONFIG_NUMA
|
|
/*
|
|
* Too small node sizes may confuse the VM badly. Usually they
|
|
* result from BIOS bugs. So dont recognize nodes as standalone
|
|
* NUMA entities that have less than this amount of RAM listed:
|
|
*/
|
|
#define NODE_MIN_SIZE (4*1024*1024)
|
|
|
|
extern void __init init_cpu_to_node(void);
|
|
extern int __cpuinit numa_cpu_node(int cpu);
|
|
extern void __cpuinit numa_add_cpu(int cpu);
|
|
extern void __cpuinit numa_remove_cpu(int cpu);
|
|
|
|
#ifdef CONFIG_NUMA_EMU
|
|
#define FAKE_NODE_MIN_SIZE ((u64)32 << 20)
|
|
#define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL))
|
|
void numa_emu_cmdline(char *);
|
|
#endif /* CONFIG_NUMA_EMU */
|
|
#else
|
|
static inline void init_cpu_to_node(void) { }
|
|
static inline int numa_cpu_node(int cpu) { return NUMA_NO_NODE; }
|
|
static inline void numa_add_cpu(int cpu, int node) { }
|
|
static inline void numa_remove_cpu(int cpu) { }
|
|
#endif
|
|
|
|
#endif /* _ASM_X86_NUMA_64_H */
|