aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/numa.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/x86/include/asm/numa.h
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'arch/x86/include/asm/numa.h')
-rw-r--r--arch/x86/include/asm/numa.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/arch/x86/include/asm/numa.h b/arch/x86/include/asm/numa.h
index 27da400d3138..bfacd2ccf651 100644
--- a/arch/x86/include/asm/numa.h
+++ b/arch/x86/include/asm/numa.h
@@ -1,5 +1,85 @@
1#ifndef _ASM_X86_NUMA_H
2#define _ASM_X86_NUMA_H
3
4#include <linux/nodemask.h>
5
6#include <asm/topology.h>
7#include <asm/apicdef.h>
8
9#ifdef CONFIG_NUMA
10
11#define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
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;
22
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];
32extern nodemask_t numa_nodes_parsed __initdata;
33
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
37static inline void set_apicid_to_node(int apicid, s16 node)
38{
39 __apicid_to_node[apicid] = node;
40}
41
42extern int __cpuinit numa_cpu_node(int cpu);
43
44#else /* CONFIG_NUMA */
45static inline void set_apicid_to_node(int apicid, s16 node)
46{
47}
48
49static inline int numa_cpu_node(int cpu)
50{
51 return NUMA_NO_NODE;
52}
53#endif /* CONFIG_NUMA */
54
1#ifdef CONFIG_X86_32 55#ifdef CONFIG_X86_32
2# include "numa_32.h" 56# include "numa_32.h"
3#else 57#else
4# include "numa_64.h" 58# include "numa_64.h"
5#endif 59#endif
60
61#ifdef CONFIG_NUMA
62extern void __cpuinit numa_set_node(int cpu, int node);
63extern void __cpuinit numa_clear_node(int cpu);
64extern void __init init_cpu_to_node(void);
65extern void __cpuinit numa_add_cpu(int cpu);
66extern void __cpuinit numa_remove_cpu(int cpu);
67#else /* CONFIG_NUMA */
68static inline void numa_set_node(int cpu, int node) { }
69static inline void numa_clear_node(int cpu) { }
70static inline void init_cpu_to_node(void) { }
71static inline void numa_add_cpu(int cpu) { }
72static inline void numa_remove_cpu(int cpu) { }
73#endif /* CONFIG_NUMA */
74
75#ifdef CONFIG_DEBUG_PER_CPU_MAPS
76void debug_cpumask_set_cpu(int cpu, int node, bool enable);
77#endif
78
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))
82void numa_emu_cmdline(char *);
83#endif /* CONFIG_NUMA_EMU */
84
85#endif /* _ASM_X86_NUMA_H */