topology.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef _ASM_X86_64_TOPOLOGY_H
  2. #define _ASM_X86_64_TOPOLOGY_H
  3. #include <linux/config.h>
  4. #ifdef CONFIG_NUMA
  5. #include <asm/mpspec.h>
  6. #include <asm/bitops.h>
  7. /* Map the K8 CPU local memory controllers to a simple 1:1 CPU:NODE topology */
  8. extern cpumask_t cpu_online_map;
  9. extern unsigned char cpu_to_node[];
  10. extern cpumask_t node_to_cpumask[];
  11. #ifdef CONFIG_ACPI_NUMA
  12. extern int __node_distance(int, int);
  13. #define node_distance(a,b) __node_distance(a,b)
  14. /* #else fallback version */
  15. #endif
  16. #define cpu_to_node(cpu) (cpu_to_node[cpu])
  17. #define parent_node(node) (node)
  18. #define node_to_first_cpu(node) (__ffs(node_to_cpumask[node]))
  19. #define node_to_cpumask(node) (node_to_cpumask[node])
  20. #define pcibus_to_node(bus) ((long)(bus->sysdata))
  21. #define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus));
  22. /* sched_domains SD_NODE_INIT for x86_64 machines */
  23. #define SD_NODE_INIT (struct sched_domain) { \
  24. .span = CPU_MASK_NONE, \
  25. .parent = NULL, \
  26. .groups = NULL, \
  27. .min_interval = 8, \
  28. .max_interval = 32, \
  29. .busy_factor = 32, \
  30. .imbalance_pct = 125, \
  31. .cache_hot_time = (10*1000000), \
  32. .cache_nice_tries = 2, \
  33. .busy_idx = 3, \
  34. .idle_idx = 2, \
  35. .newidle_idx = 0, \
  36. .wake_idx = 1, \
  37. .forkexec_idx = 1, \
  38. .per_cpu_gain = 100, \
  39. .flags = SD_LOAD_BALANCE \
  40. | SD_BALANCE_FORK \
  41. | SD_BALANCE_EXEC \
  42. | SD_WAKE_BALANCE, \
  43. .last_balance = jiffies, \
  44. .balance_interval = 1, \
  45. .nr_balance_failed = 0, \
  46. }
  47. #endif
  48. #include <asm-generic/topology.h>
  49. #endif