2011-01-23 13:37:39 +00:00
|
|
|
#ifndef _ASM_X86_NUMA_H
|
|
|
|
#define _ASM_X86_NUMA_H
|
|
|
|
|
2011-05-02 12:18:52 +00:00
|
|
|
#include <linux/nodemask.h>
|
|
|
|
|
2011-01-23 13:37:41 +00:00
|
|
|
#include <asm/topology.h>
|
2011-01-23 13:37:39 +00:00
|
|
|
#include <asm/apicdef.h>
|
|
|
|
|
|
|
|
#ifdef CONFIG_NUMA
|
2011-02-16 16:11:07 +00:00
|
|
|
|
|
|
|
#define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
|
2011-05-02 12:18:53 +00:00
|
|
|
#define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT))
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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 int numa_off;
|
2011-02-16 16:11:07 +00:00
|
|
|
|
2011-01-23 13:37:39 +00:00
|
|
|
/*
|
|
|
|
* __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];
|
2011-05-02 12:18:53 +00:00
|
|
|
extern nodemask_t numa_nodes_parsed __initdata;
|
2011-01-23 13:37:39 +00:00
|
|
|
|
2011-05-02 12:18:53 +00:00
|
|
|
extern int __init numa_add_memblk(int nodeid, u64 start, u64 end);
|
|
|
|
extern void __init numa_set_distance(int from, int to, int distance);
|
|
|
|
|
2011-01-23 13:37:39 +00:00
|
|
|
static inline void set_apicid_to_node(int apicid, s16 node)
|
|
|
|
{
|
|
|
|
__apicid_to_node[apicid] = node;
|
|
|
|
}
|
2011-05-02 12:18:52 +00:00
|
|
|
|
|
|
|
extern int __cpuinit numa_cpu_node(int cpu);
|
|
|
|
|
2011-01-23 13:37:39 +00:00
|
|
|
#else /* CONFIG_NUMA */
|
|
|
|
static inline void set_apicid_to_node(int apicid, s16 node)
|
|
|
|
{
|
|
|
|
}
|
2011-05-02 12:18:52 +00:00
|
|
|
|
|
|
|
static inline int numa_cpu_node(int cpu)
|
|
|
|
{
|
|
|
|
return NUMA_NO_NODE;
|
|
|
|
}
|
2011-01-23 13:37:39 +00:00
|
|
|
#endif /* CONFIG_NUMA */
|
|
|
|
|
2007-10-11 09:20:03 +00:00
|
|
|
#ifdef CONFIG_X86_32
|
2012-10-02 17:01:25 +00:00
|
|
|
# include <asm/numa_32.h>
|
2007-10-11 09:20:03 +00:00
|
|
|
#else
|
2012-10-02 17:01:25 +00:00
|
|
|
# include <asm/numa_64.h>
|
2007-10-11 09:20:03 +00:00
|
|
|
#endif
|
2011-01-23 13:37:39 +00:00
|
|
|
|
2011-01-23 13:37:40 +00:00
|
|
|
#ifdef CONFIG_NUMA
|
|
|
|
extern void __cpuinit numa_set_node(int cpu, int node);
|
|
|
|
extern void __cpuinit numa_clear_node(int cpu);
|
2011-01-23 13:37:42 +00:00
|
|
|
extern void __init init_cpu_to_node(void);
|
2011-01-23 13:37:41 +00:00
|
|
|
extern void __cpuinit numa_add_cpu(int cpu);
|
|
|
|
extern void __cpuinit numa_remove_cpu(int cpu);
|
2011-01-23 13:37:40 +00:00
|
|
|
#else /* CONFIG_NUMA */
|
|
|
|
static inline void numa_set_node(int cpu, int node) { }
|
|
|
|
static inline void numa_clear_node(int cpu) { }
|
2011-01-23 13:37:42 +00:00
|
|
|
static inline void init_cpu_to_node(void) { }
|
2011-01-23 13:37:41 +00:00
|
|
|
static inline void numa_add_cpu(int cpu) { }
|
|
|
|
static inline void numa_remove_cpu(int cpu) { }
|
2011-01-23 13:37:40 +00:00
|
|
|
#endif /* CONFIG_NUMA */
|
|
|
|
|
2011-01-23 13:37:41 +00:00
|
|
|
#ifdef CONFIG_DEBUG_PER_CPU_MAPS
|
2011-04-21 02:19:13 +00:00
|
|
|
void debug_cpumask_set_cpu(int cpu, int node, bool enable);
|
2011-01-23 13:37:41 +00:00
|
|
|
#endif
|
|
|
|
|
2011-05-02 12:18:53 +00:00
|
|
|
#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 */
|
|
|
|
|
2011-01-23 13:37:39 +00:00
|
|
|
#endif /* _ASM_X86_NUMA_H */
|