Merge branch 'linus' into perf/core, to fix conflicts
[deliverable/linux.git] / arch / x86 / include / asm / numa.h
CommitLineData
bbc9e2f4
TH
1#ifndef _ASM_X86_NUMA_H
2#define _ASM_X86_NUMA_H
3
6bd26273
TH
4#include <linux/nodemask.h>
5
de2d9445 6#include <asm/topology.h>
bbc9e2f4
TH
7#include <asm/apicdef.h>
8
9#ifdef CONFIG_NUMA
ef396ec9
TH
10
11#define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
a4106eae
TH
12#define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT))
13
14/*
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:
18 */
19#define NODE_MIN_SIZE (4*1024*1024)
20
21extern int numa_off;
ef396ec9 22
bbc9e2f4
TH
23/*
24 * __apicid_to_node[] stores the raw mapping between physical apicid and
25 * node and is used to initialize cpu_to_node mapping.
26 *
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
29 * numa_cpu_node().
30 */
31extern s16 __apicid_to_node[MAX_LOCAL_APIC];
e6df595b 32extern nodemask_t numa_nodes_parsed __initdata;
bbc9e2f4 33
b0d31080
TH
34extern int __init numa_add_memblk(int nodeid, u64 start, u64 end);
35extern void __init numa_set_distance(int from, int to, int distance);
36
bbc9e2f4
TH
37static inline void set_apicid_to_node(int apicid, s16 node)
38{
39 __apicid_to_node[apicid] = node;
40}
6bd26273 41
148f9bb8 42extern int numa_cpu_node(int cpu);
6bd26273 43
bbc9e2f4
TH
44#else /* CONFIG_NUMA */
45static inline void set_apicid_to_node(int apicid, s16 node)
46{
47}
6bd26273
TH
48
49static inline int numa_cpu_node(int cpu)
50{
51 return NUMA_NO_NODE;
52}
bbc9e2f4
TH
53#endif /* CONFIG_NUMA */
54
96a388de 55#ifdef CONFIG_X86_32
a1ce3928 56# include <asm/numa_32.h>
96a388de 57#endif
bbc9e2f4 58
645a7919 59#ifdef CONFIG_NUMA
e13fe869
WC
60extern void numa_set_node(int cpu, int node);
61extern void numa_clear_node(int cpu);
8db78cc4 62extern void __init init_cpu_to_node(void);
148f9bb8
PG
63extern void numa_add_cpu(int cpu);
64extern void numa_remove_cpu(int cpu);
645a7919
TH
65#else /* CONFIG_NUMA */
66static inline void numa_set_node(int cpu, int node) { }
67static inline void numa_clear_node(int cpu) { }
8db78cc4 68static inline void init_cpu_to_node(void) { }
de2d9445
TH
69static inline void numa_add_cpu(int cpu) { }
70static inline void numa_remove_cpu(int cpu) { }
645a7919
TH
71#endif /* CONFIG_NUMA */
72
de2d9445 73#ifdef CONFIG_DEBUG_PER_CPU_MAPS
7a6c6547 74void debug_cpumask_set_cpu(int cpu, int node, bool enable);
de2d9445
TH
75#endif
76
a4106eae
TH
77#ifdef CONFIG_NUMA_EMU
78#define FAKE_NODE_MIN_SIZE ((u64)32 << 20)
79#define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL))
80void numa_emu_cmdline(char *);
81#endif /* CONFIG_NUMA_EMU */
82
bbc9e2f4 83#endif /* _ASM_X86_NUMA_H */
This page took 0.505827 seconds and 5 git commands to generate.