topology.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 unsigned char pci_bus_to_node[];
  11. extern cpumask_t node_to_cpumask[];
  12. #ifdef CONFIG_ACPI_NUMA
  13. extern int __node_distance(int, int);
  14. #define node_distance(a,b) __node_distance(a,b)
  15. /* #else fallback version */
  16. #endif
  17. #define cpu_to_node(cpu) (cpu_to_node[cpu])
  18. #define parent_node(node) (node)
  19. #define node_to_first_cpu(node) (__ffs(node_to_cpumask[node]))
  20. #define node_to_cpumask(node) (node_to_cpumask[node])
  21. #define pcibus_to_node(bus) pci_bus_to_node[(bus)->number]
  22. #define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus));
  23. /* sched_domains SD_NODE_INIT for x86_64 machines */
  24. #define SD_NODE_INIT (struct sched_domain) { \
  25. .span = CPU_MASK_NONE, \
  26. .parent = NULL, \
  27. .groups = NULL, \
  28. .min_interval = 8, \
  29. .max_interval = 32, \
  30. .busy_factor = 32, \
  31. .imbalance_pct = 125, \
  32. .cache_hot_time = (10*1000000), \
  33. .cache_nice_tries = 2, \
  34. .busy_idx = 3, \
  35. .idle_idx = 2, \
  36. .newidle_idx = 0, \
  37. .wake_idx = 1, \
  38. .forkexec_idx = 1, \
  39. .per_cpu_gain = 100, \
  40. .flags = SD_LOAD_BALANCE \
  41. | SD_BALANCE_FORK \
  42. | SD_BALANCE_EXEC \
  43. | SD_WAKE_BALANCE, \
  44. .last_balance = jiffies, \
  45. .balance_interval = 1, \
  46. .nr_balance_failed = 0, \
  47. }
  48. #endif
  49. #include <asm-generic/topology.h>
  50. #endif