blob: 823e070e7c2603f6e42c65ef22d98d6dcd72cddc [file] [log] [blame]
H. Peter Anvin1965aae2008-10-22 22:26:29 -07001#ifndef _ASM_X86_NUMA_64_H
2#define _ASM_X86_NUMA_64_H
Linus Torvalds1da177e2005-04-16 15:20:36 -07003
4#include <linux/nodemask.h>
Andrew Mortonafc54652007-10-17 18:04:32 +02005#include <asm/apicdef.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
Andi Kleenabe059e2006-03-25 16:29:12 +01007struct bootnode {
Joe Perchescb046ee2008-03-23 01:02:55 -07008 u64 start;
9 u64 end;
Linus Torvalds1da177e2005-04-16 15:20:36 -070010};
11
Suresh Siddha6ec6e0d2008-03-25 10:14:35 -070012extern int compute_hash_shift(struct bootnode *nodes, int numblks,
13 int *nodeids);
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
15#define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT))
16
Linus Torvalds1da177e2005-04-16 15:20:36 -070017extern void numa_init_array(void);
18extern int numa_off;
19
travis@sgi.com43238382008-01-30 13:33:25 +010020extern s16 apicid_to_node[MAX_LOCAL_APIC];
Thomas Gleixneraaa64e02008-01-30 13:30:17 +010021
Thomas Gleixneraaa64e02008-01-30 13:30:17 +010022extern unsigned long numa_free_all_bootmem(void);
23extern void setup_node_bootmem(int nodeid, unsigned long start,
24 unsigned long end);
25
Ravikiran Thirumalai05b3cbd2006-01-11 22:45:36 +010026#ifdef CONFIG_NUMA
Yinghai Lu7c437692009-05-15 13:59:37 -070027/*
28 * Too small node sizes may confuse the VM badly. Usually they
29 * result from BIOS bugs. So dont recognize nodes as standalone
30 * NUMA entities that have less than this amount of RAM listed:
31 */
32#define NODE_MIN_SIZE (4*1024*1024)
33
Ravikiran Thirumalai05b3cbd2006-01-11 22:45:36 +010034extern void __init init_cpu_to_node(void);
Mike Travis23ca4bb2008-05-12 21:21:12 +020035extern void __cpuinit numa_set_node(int cpu, int node);
36extern void __cpuinit numa_clear_node(int cpu);
37extern void __cpuinit numa_add_cpu(int cpu);
38extern void __cpuinit numa_remove_cpu(int cpu);
David Rientjes8df5bb342010-02-15 13:43:30 -080039
40#ifdef CONFIG_NUMA_EMU
41#define FAKE_NODE_MIN_SIZE ((u64)64 << 20)
42#define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL))
43#endif /* CONFIG_NUMA_EMU */
Ravikiran Thirumalai05b3cbd2006-01-11 22:45:36 +010044#else
Mike Travis23ca4bb2008-05-12 21:21:12 +020045static inline void init_cpu_to_node(void) { }
46static inline void numa_set_node(int cpu, int node) { }
47static inline void numa_clear_node(int cpu) { }
48static inline void numa_add_cpu(int cpu, int node) { }
49static inline void numa_remove_cpu(int cpu) { }
Ravikiran Thirumalai05b3cbd2006-01-11 22:45:36 +010050#endif
Andi Kleen0b07e982005-09-12 18:49:24 +020051
H. Peter Anvin1965aae2008-10-22 22:26:29 -070052#endif /* _ASM_X86_NUMA_64_H */