topology.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. * Copyright (C) 2002, Erich Focht, NEC
  3. *
  4. * All rights reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. */
  11. #ifndef _ASM_IA64_TOPOLOGY_H
  12. #define _ASM_IA64_TOPOLOGY_H
  13. #include <asm/acpi.h>
  14. #include <asm/numa.h>
  15. #include <asm/smp.h>
  16. #ifdef CONFIG_NUMA
  17. /* Nodes w/o CPUs are preferred for memory allocations, see build_zonelists */
  18. #define PENALTY_FOR_NODE_WITH_CPUS 255
  19. /*
  20. * Distance above which we begin to use zone reclaim
  21. */
  22. #define RECLAIM_DISTANCE 15
  23. /*
  24. * Returns the number of the node containing CPU 'cpu'
  25. */
  26. #define cpu_to_node(cpu) (int)(cpu_to_node_map[cpu])
  27. /*
  28. * Returns a bitmask of CPUs on Node 'node'.
  29. */
  30. #define node_to_cpumask(node) (node_to_cpu_mask[node])
  31. #define cpumask_of_node(node) (&node_to_cpu_mask[node])
  32. /*
  33. * Returns the number of the node containing Node 'nid'.
  34. * Not implemented here. Multi-level hierarchies detected with
  35. * the help of node_distance().
  36. */
  37. #define parent_node(nid) (nid)
  38. /*
  39. * Determines the node for a given pci bus
  40. */
  41. #define pcibus_to_node(bus) PCI_CONTROLLER(bus)->node
  42. void build_cpu_to_node_map(void);
  43. #define SD_CPU_INIT (struct sched_domain) { \
  44. .parent = NULL, \
  45. .child = NULL, \
  46. .groups = NULL, \
  47. .min_interval = 1, \
  48. .max_interval = 4, \
  49. .busy_factor = 64, \
  50. .imbalance_pct = 125, \
  51. .cache_nice_tries = 2, \
  52. .busy_idx = 2, \
  53. .idle_idx = 1, \
  54. .newidle_idx = 2, \
  55. .wake_idx = 1, \
  56. .forkexec_idx = 1, \
  57. .flags = SD_LOAD_BALANCE \
  58. | SD_BALANCE_NEWIDLE \
  59. | SD_BALANCE_EXEC \
  60. | SD_WAKE_AFFINE, \
  61. .last_balance = jiffies, \
  62. .balance_interval = 1, \
  63. .nr_balance_failed = 0, \
  64. }
  65. /* sched_domains SD_NODE_INIT for IA64 NUMA machines */
  66. #define SD_NODE_INIT (struct sched_domain) { \
  67. .parent = NULL, \
  68. .child = NULL, \
  69. .groups = NULL, \
  70. .min_interval = 8, \
  71. .max_interval = 8*(min(num_online_cpus(), 32U)), \
  72. .busy_factor = 64, \
  73. .imbalance_pct = 125, \
  74. .cache_nice_tries = 2, \
  75. .busy_idx = 3, \
  76. .idle_idx = 2, \
  77. .newidle_idx = 2, \
  78. .wake_idx = 1, \
  79. .forkexec_idx = 1, \
  80. .flags = SD_LOAD_BALANCE \
  81. | SD_BALANCE_EXEC \
  82. | SD_BALANCE_FORK \
  83. | SD_SERIALIZE \
  84. | SD_WAKE_BALANCE, \
  85. .last_balance = jiffies, \
  86. .balance_interval = 64, \
  87. .nr_balance_failed = 0, \
  88. }
  89. #endif /* CONFIG_NUMA */
  90. #ifdef CONFIG_SMP
  91. #define topology_physical_package_id(cpu) (cpu_data(cpu)->socket_id)
  92. #define topology_core_id(cpu) (cpu_data(cpu)->core_id)
  93. #define topology_core_siblings(cpu) (cpu_core_map[cpu])
  94. #define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu))
  95. #define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
  96. #define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu))
  97. #define smt_capable() (smp_num_siblings > 1)
  98. #endif
  99. extern void arch_fix_phys_package_id(int num, u32 slot);
  100. #define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \
  101. cpu_all_mask : \
  102. cpumask_of_node(pcibus_to_node(bus)))
  103. #include <asm-generic/topology.h>
  104. #endif /* _ASM_IA64_TOPOLOGY_H */