forked from Minki/linux
91556237ec
numa_nodes[] doesn't carry any information which isn't present in numa_meminfo. Each entry is simply min/max range of all the memblks for the node. This is not only redundant but also inaccurate when memblks for different nodes interleave - for example, find_node_by_addr() can return the wrong nodeid. Kill numa_nodes[] and always use numa_meminfo instead. * nodes_cover_memory() is renamed to numa_meminfo_cover_memory() and now operations on numa_meminfo and returns bool. * setup_node_bootmem() needs min/max range. Compute the range on the fly. setup_node_bootmem() invocation is restructured to use outer loop instead of hardcoding the double invocations. * find_node_by_addr() now operates on numa_meminfo. * setup_physnodes() builds physnodes[] from memblks. This will go away when emulation code is updated to use struct numa_meminfo. This patch also makes the following misc changes. * Clearing of nodes_add[] clearing is converted to memset(). * numa_add_memblk() in amd_numa_init() is moved down a bit for consistency. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Brian Gerst <brgerst@gmail.com> Cc: Cyrill Gorcunov <gorcunov@gmail.com> Cc: Shaohui Zheng <shaohui.zheng@intel.com> Cc: David Rientjes <rientjes@google.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: H. Peter Anvin <hpa@linux.intel.com>
44 lines
1.1 KiB
C
44 lines
1.1 KiB
C
#ifndef _ASM_X86_NUMA_64_H
|
|
#define _ASM_X86_NUMA_64_H
|
|
|
|
#include <linux/nodemask.h>
|
|
|
|
struct bootnode {
|
|
u64 start;
|
|
u64 end;
|
|
};
|
|
|
|
#define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT))
|
|
|
|
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 nodemask_t cpu_nodes_parsed __initdata;
|
|
extern nodemask_t mem_nodes_parsed __initdata;
|
|
|
|
extern int __cpuinit numa_cpu_node(int cpu);
|
|
extern int __init numa_add_memblk(int nodeid, u64 start, u64 end);
|
|
|
|
#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 *);
|
|
int __init find_node_by_addr(unsigned long addr);
|
|
#endif /* CONFIG_NUMA_EMU */
|
|
#else
|
|
static inline int numa_cpu_node(int cpu) { return NUMA_NO_NODE; }
|
|
#endif
|
|
|
|
#endif /* _ASM_X86_NUMA_64_H */
|