topology.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*
  2. * linux/include/asm-ia64/topology.h
  3. *
  4. * Copyright (C) 2002, Erich Focht, NEC
  5. *
  6. * All rights reserved.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. */
  13. #ifndef _ASM_IA64_TOPOLOGY_H
  14. #define _ASM_IA64_TOPOLOGY_H
  15. #include <asm/acpi.h>
  16. #include <asm/numa.h>
  17. #include <asm/smp.h>
  18. #ifdef CONFIG_NUMA
  19. /*
  20. * Returns the number of the node containing CPU 'cpu'
  21. */
  22. #define cpu_to_node(cpu) (int)(cpu_to_node_map[cpu])
  23. /*
  24. * Returns a bitmask of CPUs on Node 'node'.
  25. */
  26. #define node_to_cpumask(node) (node_to_cpu_mask[node])
  27. /*
  28. * Returns the number of the node containing Node 'nid'.
  29. * Not implemented here. Multi-level hierarchies detected with
  30. * the help of node_distance().
  31. */
  32. #define parent_node(nid) (nid)
  33. /*
  34. * Returns the number of the first CPU on Node 'node'.
  35. */
  36. #define node_to_first_cpu(node) (__ffs(node_to_cpumask(node)))
  37. void build_cpu_to_node_map(void);
  38. #define SD_CPU_INIT (struct sched_domain) { \
  39. .span = CPU_MASK_NONE, \
  40. .parent = NULL, \
  41. .groups = NULL, \
  42. .min_interval = 1, \
  43. .max_interval = 4, \
  44. .busy_factor = 64, \
  45. .imbalance_pct = 125, \
  46. .cache_hot_time = (10*1000000), \
  47. .per_cpu_gain = 100, \
  48. .cache_nice_tries = 2, \
  49. .busy_idx = 2, \
  50. .idle_idx = 1, \
  51. .newidle_idx = 2, \
  52. .wake_idx = 1, \
  53. .forkexec_idx = 1, \
  54. .flags = SD_LOAD_BALANCE \
  55. | SD_BALANCE_NEWIDLE \
  56. | SD_BALANCE_EXEC \
  57. | SD_WAKE_AFFINE, \
  58. .last_balance = jiffies, \
  59. .balance_interval = 1, \
  60. .nr_balance_failed = 0, \
  61. }
  62. /* sched_domains SD_NODE_INIT for IA64 NUMA machines */
  63. #define SD_NODE_INIT (struct sched_domain) { \
  64. .span = CPU_MASK_NONE, \
  65. .parent = NULL, \
  66. .groups = NULL, \
  67. .min_interval = 8, \
  68. .max_interval = 8*(min(num_online_cpus(), 32)), \
  69. .busy_factor = 64, \
  70. .imbalance_pct = 125, \
  71. .cache_hot_time = (10*1000000), \
  72. .cache_nice_tries = 2, \
  73. .busy_idx = 3, \
  74. .idle_idx = 2, \
  75. .newidle_idx = 0, /* unused */ \
  76. .wake_idx = 1, \
  77. .forkexec_idx = 1, \
  78. .per_cpu_gain = 100, \
  79. .flags = SD_LOAD_BALANCE \
  80. | SD_BALANCE_EXEC \
  81. | SD_BALANCE_FORK \
  82. | SD_WAKE_BALANCE, \
  83. .last_balance = jiffies, \
  84. .balance_interval = 64, \
  85. .nr_balance_failed = 0, \
  86. }
  87. /* sched_domains SD_ALLNODES_INIT for IA64 NUMA machines */
  88. #define SD_ALLNODES_INIT (struct sched_domain) { \
  89. .span = CPU_MASK_NONE, \
  90. .parent = NULL, \
  91. .groups = NULL, \
  92. .min_interval = 64, \
  93. .max_interval = 64*num_online_cpus(), \
  94. .busy_factor = 128, \
  95. .imbalance_pct = 133, \
  96. .cache_hot_time = (10*1000000), \
  97. .cache_nice_tries = 1, \
  98. .busy_idx = 3, \
  99. .idle_idx = 3, \
  100. .newidle_idx = 0, /* unused */ \
  101. .wake_idx = 0, /* unused */ \
  102. .forkexec_idx = 0, /* unused */ \
  103. .per_cpu_gain = 100, \
  104. .flags = SD_LOAD_BALANCE, \
  105. .last_balance = jiffies, \
  106. .balance_interval = 64, \
  107. .nr_balance_failed = 0, \
  108. }
  109. #endif /* CONFIG_NUMA */
  110. #include <asm-generic/topology.h>
  111. #endif /* _ASM_IA64_TOPOLOGY_H */