topology.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. /* sched_domains SD_NODE_INIT for PPC64 machines */
  29. #define SD_NODE_INIT (struct sched_domain) { \
  30. .span = CPU_MASK_NONE, \
  31. .parent = NULL, \
  32. .groups = NULL, \
  33. .min_interval = 8, \
  34. .max_interval = 32, \
  35. .busy_factor = 32, \
  36. .imbalance_pct = 125, \
  37. .cache_hot_time = (10*1000000), \
  38. .cache_nice_tries = 1, \
  39. .per_cpu_gain = 100, \
  40. .flags = SD_LOAD_BALANCE \
  41. | SD_BALANCE_EXEC \
  42. | SD_BALANCE_NEWIDLE \
  43. | SD_WAKE_IDLE \
  44. | SD_WAKE_BALANCE, \
  45. .last_balance = jiffies, \
  46. .balance_interval = 1, \
  47. .nr_balance_failed = 0, \
  48. }
  49. #else
  50. #include <asm-generic/topology.h>
  51. #endif /* CONFIG_NUMA */
  52. #endif /* _ASM_POWERPC_TOPOLOGY_H */