topology.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef _ASM_POWERPC_TOPOLOGY_H
  2. #define _ASM_POWERPC_TOPOLOGY_H
  3. #include <linux/config.h>
  4. #ifdef CONFIG_NUMA
  5. #include <asm/mmzone.h>
  6. static inline int cpu_to_node(int cpu)
  7. {
  8. int node;
  9. node = numa_cpu_lookup_table[cpu];
  10. #ifdef DEBUG_NUMA
  11. BUG_ON(node == -1);
  12. #endif
  13. return node;
  14. }
  15. #define parent_node(node) (node)
  16. static inline cpumask_t node_to_cpumask(int node)
  17. {
  18. return numa_cpumask_lookup_table[node];
  19. }
  20. static inline int node_to_first_cpu(int node)
  21. {
  22. cpumask_t tmp;
  23. tmp = node_to_cpumask(node);
  24. return first_cpu(tmp);
  25. }
  26. #define pcibus_to_node(node) (-1)
  27. #define pcibus_to_cpumask(bus) (cpu_online_map)
  28. #define nr_cpus_node(node) (nr_cpus_in_node[node])
  29. /* sched_domains SD_NODE_INIT for PPC64 machines */
  30. #define SD_NODE_INIT (struct sched_domain) { \
  31. .span = CPU_MASK_NONE, \
  32. .parent = NULL, \
  33. .groups = NULL, \
  34. .min_interval = 8, \
  35. .max_interval = 32, \
  36. .busy_factor = 32, \
  37. .imbalance_pct = 125, \
  38. .cache_hot_time = (10*1000000), \
  39. .cache_nice_tries = 1, \
  40. .per_cpu_gain = 100, \
  41. .flags = SD_LOAD_BALANCE \
  42. | SD_BALANCE_EXEC \
  43. | SD_BALANCE_NEWIDLE \
  44. | SD_WAKE_IDLE \
  45. | SD_WAKE_BALANCE, \
  46. .last_balance = jiffies, \
  47. .balance_interval = 1, \
  48. .nr_balance_failed = 0, \
  49. }
  50. #else
  51. #include <asm-generic/topology.h>
  52. #endif /* CONFIG_NUMA */
  53. #endif /* _ASM_POWERPC_TOPOLOGY_H */