Blame view

arch/x86/include/asm/numa.h 2.26 KB
bbc9e2f45   Tejun Heo   x86: Unify cpu/ap...
1
2
  #ifndef _ASM_X86_NUMA_H
  #define _ASM_X86_NUMA_H
6bd262731   Tejun Heo   x86, NUMA: Unify ...
3
  #include <linux/nodemask.h>
de2d9445f   Tejun Heo   x86: Unify node_t...
4
  #include <asm/topology.h>
bbc9e2f45   Tejun Heo   x86: Unify cpu/ap...
5
6
7
  #include <asm/apicdef.h>
  
  #ifdef CONFIG_NUMA
ef396ec96   Tejun Heo   x86-64, NUMA: Fac...
8
9
  
  #define NR_NODE_MEMBLKS		(MAX_NUMNODES*2)
a4106eae6   Tejun Heo   x86, NUMA: Move N...
10
11
12
13
14
15
16
17
18
19
  #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;
ef396ec96   Tejun Heo   x86-64, NUMA: Fac...
20

bbc9e2f45   Tejun Heo   x86: Unify cpu/ap...
21
22
23
24
25
26
27
28
29
  /*
   * __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];
e6df595b3   Tejun Heo   x86, NUMA: Move n...
30
  extern nodemask_t numa_nodes_parsed __initdata;
bbc9e2f45   Tejun Heo   x86: Unify cpu/ap...
31

b0d310801   Tejun Heo   x86-32, NUMA: imp...
32
33
  extern int __init numa_add_memblk(int nodeid, u64 start, u64 end);
  extern void __init numa_set_distance(int from, int to, int distance);
bbc9e2f45   Tejun Heo   x86: Unify cpu/ap...
34
35
36
37
  static inline void set_apicid_to_node(int apicid, s16 node)
  {
  	__apicid_to_node[apicid] = node;
  }
6bd262731   Tejun Heo   x86, NUMA: Unify ...
38
39
  
  extern int __cpuinit numa_cpu_node(int cpu);
bbc9e2f45   Tejun Heo   x86: Unify cpu/ap...
40
41
42
43
  #else	/* CONFIG_NUMA */
  static inline void set_apicid_to_node(int apicid, s16 node)
  {
  }
6bd262731   Tejun Heo   x86, NUMA: Unify ...
44
45
46
47
48
  
  static inline int numa_cpu_node(int cpu)
  {
  	return NUMA_NO_NODE;
  }
bbc9e2f45   Tejun Heo   x86: Unify cpu/ap...
49
  #endif	/* CONFIG_NUMA */
96a388de5   Thomas Gleixner   i386/x86_64: move...
50
51
52
53
54
  #ifdef CONFIG_X86_32
  # include "numa_32.h"
  #else
  # include "numa_64.h"
  #endif
bbc9e2f45   Tejun Heo   x86: Unify cpu/ap...
55

645a79195   Tejun Heo   x86: Unify CPU ->...
56
57
58
  #ifdef CONFIG_NUMA
  extern void __cpuinit numa_set_node(int cpu, int node);
  extern void __cpuinit numa_clear_node(int cpu);
8db78cc4b   Tejun Heo   x86: Unify NUMA i...
59
  extern void __init init_cpu_to_node(void);
de2d9445f   Tejun Heo   x86: Unify node_t...
60
61
  extern void __cpuinit numa_add_cpu(int cpu);
  extern void __cpuinit numa_remove_cpu(int cpu);
645a79195   Tejun Heo   x86: Unify CPU ->...
62
63
64
  #else	/* CONFIG_NUMA */
  static inline void numa_set_node(int cpu, int node)	{ }
  static inline void numa_clear_node(int cpu)		{ }
8db78cc4b   Tejun Heo   x86: Unify NUMA i...
65
  static inline void init_cpu_to_node(void)		{ }
de2d9445f   Tejun Heo   x86: Unify node_t...
66
67
  static inline void numa_add_cpu(int cpu)		{ }
  static inline void numa_remove_cpu(int cpu)		{ }
645a79195   Tejun Heo   x86: Unify CPU ->...
68
  #endif	/* CONFIG_NUMA */
de2d9445f   Tejun Heo   x86: Unify node_t...
69
  #ifdef CONFIG_DEBUG_PER_CPU_MAPS
7a6c65478   David Rientjes   x86, numa: Fix cp...
70
  void debug_cpumask_set_cpu(int cpu, int node, bool enable);
de2d9445f   Tejun Heo   x86: Unify node_t...
71
  #endif
a4106eae6   Tejun Heo   x86, NUMA: Move N...
72
73
74
75
76
  #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 */
bbc9e2f45   Tejun Heo   x86: Unify cpu/ap...
77
  #endif	/* _ASM_X86_NUMA_H */