upgrade to linux 2.6.10-1.12_FC2
[linux-2.6.git] / include / asm-x86_64 / topology.h
1 #ifndef _ASM_X86_64_TOPOLOGY_H
2 #define _ASM_X86_64_TOPOLOGY_H
3
4 #include <linux/config.h>
5
6 #ifdef CONFIG_DISCONTIGMEM
7
8 #include <asm/mpspec.h>
9 #include <asm/bitops.h>
10
11 /* Map the K8 CPU local memory controllers to a simple 1:1 CPU:NODE topology */
12
13 extern cpumask_t cpu_online_map;
14
15 extern unsigned char cpu_to_node[];
16 extern cpumask_t     node_to_cpumask[];
17 extern cpumask_t pci_bus_to_cpumask[];
18
19 #define cpu_to_node(cpu)                (cpu_to_node[cpu])
20 #define parent_node(node)               (node)
21 #define node_to_first_cpu(node)         (__ffs(node_to_cpumask[node]))
22 #define node_to_cpumask(node)           (node_to_cpumask[node])
23
24 static inline cpumask_t __pcibus_to_cpumask(int bus)
25 {
26         cpumask_t busmask = pci_bus_to_cpumask[bus];
27         cpumask_t online = cpu_online_map;
28         cpumask_t res;
29         cpus_and(res, busmask, online);
30         return res;
31 }
32 /* broken generic file uses #ifndef later on this */
33 #define pcibus_to_cpumask(bus) __pcibus_to_cpumask(bus)
34
35 #ifdef CONFIG_NUMA
36 /* sched_domains SD_NODE_INIT for x86_64 machines */
37 #define SD_NODE_INIT (struct sched_domain) {            \
38         .span                   = CPU_MASK_NONE,        \
39         .parent                 = NULL,                 \
40         .groups                 = NULL,                 \
41         .min_interval           = 8,                    \
42         .max_interval           = 32,                   \
43         .busy_factor            = 32,                   \
44         .imbalance_pct          = 125,                  \
45         .cache_hot_time         = (10*1000),            \
46         .cache_nice_tries       = 1,                    \
47         .per_cpu_gain           = 100,                  \
48         .flags                  = SD_LOAD_BALANCE       \
49                                 | SD_BALANCE_EXEC       \
50                                 | SD_WAKE_BALANCE,      \
51         .last_balance           = jiffies,              \
52         .balance_interval       = 1,                    \
53         .nr_balance_failed      = 0,                    \
54 }
55 #endif
56
57 #endif
58
59 #include <asm-generic/topology.h>
60
61 #endif