1 #ifndef _ASM_X86_NUMA_H
2 #define _ASM_X86_NUMA_H
4 #include <linux/nodemask.h>
6 #include <asm/topology.h>
7 #include <asm/apicdef.h>
11 #define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
12 #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT))
15 * Too small node sizes may confuse the VM badly. Usually they
16 * result from BIOS bugs. So dont recognize nodes as standalone
17 * NUMA entities that have less than this amount of RAM listed:
19 #define NODE_MIN_SIZE (4*1024*1024)
24 * __apicid_to_node[] stores the raw mapping between physical apicid and
25 * node and is used to initialize cpu_to_node mapping.
27 * The mapping may be overridden by apic->numa_cpu_node() on 32bit and thus
28 * should be accessed by the accessors - set_apicid_to_node() and
31 extern s16 __apicid_to_node
[MAX_LOCAL_APIC
];
32 extern nodemask_t numa_nodes_parsed __initdata
;
34 extern int __init
numa_add_memblk(int nodeid
, u64 start
, u64 end
);
35 extern void __init
numa_set_distance(int from
, int to
, int distance
);
37 static inline void set_apicid_to_node(int apicid
, s16 node
)
39 __apicid_to_node
[apicid
] = node
;
42 extern int __cpuinit
numa_cpu_node(int cpu
);
44 #else /* CONFIG_NUMA */
45 static inline void set_apicid_to_node(int apicid
, s16 node
)
49 static inline int numa_cpu_node(int cpu
)
53 #endif /* CONFIG_NUMA */
62 extern void __cpuinit
numa_set_node(int cpu
, int node
);
63 extern void __cpuinit
numa_clear_node(int cpu
);
64 extern void __init
init_cpu_to_node(void);
65 extern void __cpuinit
numa_add_cpu(int cpu
);
66 extern void __cpuinit
numa_remove_cpu(int cpu
);
67 #else /* CONFIG_NUMA */
68 static inline void numa_set_node(int cpu
, int node
) { }
69 static inline void numa_clear_node(int cpu
) { }
70 static inline void init_cpu_to_node(void) { }
71 static inline void numa_add_cpu(int cpu
) { }
72 static inline void numa_remove_cpu(int cpu
) { }
73 #endif /* CONFIG_NUMA */
75 #ifdef CONFIG_DEBUG_PER_CPU_MAPS
76 void debug_cpumask_set_cpu(int cpu
, int node
, bool enable
);
79 #ifdef CONFIG_NUMA_EMU
80 #define FAKE_NODE_MIN_SIZE ((u64)32 << 20)
81 #define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL))
82 void numa_emu_cmdline(char *);
83 #endif /* CONFIG_NUMA_EMU */
85 #endif /* _ASM_X86_NUMA_H */