1 #ifndef _ASM_POWERPC_TOPOLOGY_H
2 #define _ASM_POWERPC_TOPOLOGY_H
12 * Before going off node we want the VM to try and reclaim from the local
13 * node. It does this if the remote distance is larger than RECLAIM_DISTANCE.
14 * With the default REMOTE_DISTANCE of 20 and the default RECLAIM_DISTANCE of
15 * 20, we never reclaim and go off node straight away.
17 * To fix this we choose a smaller value of RECLAIM_DISTANCE.
19 #define RECLAIM_DISTANCE 10
22 * Before going off node we want the VM to try and reclaim from the local
23 * node. It does this if the remote distance is larger than RECLAIM_DISTANCE.
24 * With the default REMOTE_DISTANCE of 20 and the default RECLAIM_DISTANCE of
25 * 20, we never reclaim and go off node straight away.
27 * To fix this we choose a smaller value of RECLAIM_DISTANCE.
29 #define RECLAIM_DISTANCE 10
31 #include <asm/mmzone.h>
33 static inline int cpu_to_node(int cpu)
35 return numa_cpu_lookup_table[cpu];
38 #define parent_node(node) (node)
40 #define cpumask_of_node(node) ((node) == -1 ? \
42 node_to_cpumask_map[node])
44 int of_node_to_nid(struct device_node *device);
48 extern int pcibus_to_node(struct pci_bus *bus);
50 static inline int pcibus_to_node(struct pci_bus *bus)
56 #define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \
58 cpumask_of_node(pcibus_to_node(bus)))
60 /* sched_domains SD_NODE_INIT for PPC64 machines */
61 #define SD_NODE_INIT (struct sched_domain) { \
65 .imbalance_pct = 125, \
66 .cache_nice_tries = 1, \
73 .flags = 1*SD_LOAD_BALANCE \
74 | 1*SD_BALANCE_NEWIDLE \
80 | 0*SD_SHARE_CPUPOWER \
81 | 0*SD_POWERSAVINGS_BALANCE \
82 | 0*SD_SHARE_PKG_RESOURCES \
84 | 0*SD_PREFER_SIBLING \
86 .last_balance = jiffies, \
87 .balance_interval = 1, \
90 extern void __init dump_numa_cpu_topology(void);
92 extern int sysfs_add_device_to_node(struct sys_device *dev, int nid);
93 extern void sysfs_remove_device_from_node(struct sys_device *dev, int nid);
97 static inline int of_node_to_nid(struct device_node *device)
102 static inline void dump_numa_cpu_topology(void) {}
104 static inline int sysfs_add_device_to_node(struct sys_device *dev, int nid)
109 static inline void sysfs_remove_device_from_node(struct sys_device *dev,
114 #endif /* CONFIG_NUMA */
116 #include <asm-generic/topology.h>
119 #include <asm/cputable.h>
120 #define smt_capable() (cpu_has_feature(CPU_FTR_SMT))
125 #define topology_thread_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu))
126 #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu))
127 #define topology_core_id(cpu) (cpu_to_core_id(cpu))
131 #endif /* __KERNEL__ */
132 #endif /* _ASM_POWERPC_TOPOLOGY_H */