topology.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. /* Nodes w/o CPUs are preferred for memory allocations, see build_zonelists */
  20. #define PENALTY_FOR_NODE_WITH_CPUS 255
  21. /*
  22. * Distance above which we begin to use zone reclaim
  23. */
  24. #define RECLAIM_DISTANCE 15
  25. /*
  26. * Returns the number of the node containing CPU 'cpu'
  27. */
  28. #define cpu_to_node(cpu) (int)(cpu_to_node_map[cpu])
  29. /*
  30. * Returns a bitmask of CPUs on Node 'node'.
  31. */
  32. #define node_to_cpumask(node) (node_to_cpu_mask[node])
  33. /*
  34. * Returns the number of the node containing Node 'nid'.
  35. * Not implemented here. Multi-level hierarchies detected with
  36. * the help of node_distance().
  37. */
  38. #define parent_node(nid) (nid)
  39. /*
  40. * Returns the number of the first CPU on Node 'node'.
  41. */
  42. #define node_to_first_cpu(node) (first_cpu(node_to_cpumask(node)))
  43. /*
  44. * Determines the node for a given pci bus
  45. */
  46. #define pcibus_to_node(bus) PCI_CONTROLLER(bus)->node
  47. void build_cpu_to_node_map(void);
  48. #define SD_CPU_INIT (struct sched_domain) { \
  49. .span = CPU_MASK_NONE, \
  50. .parent = NULL, \
  51. .groups = NULL, \
  52. .min_interval = 1, \
  53. .max_interval = 4, \
  54. .busy_factor = 64, \
  55. .imbalance_pct = 125, \
  56. .per_cpu_gain = 100, \
  57. .cache_nice_tries = 2, \
  58. .busy_idx = 2, \
  59. .idle_idx = 1, \
  60. .newidle_idx = 2, \
  61. .wake_idx = 1, \
  62. .forkexec_idx = 1, \
  63. .flags = SD_LOAD_BALANCE \
  64. | SD_BALANCE_NEWIDLE \
  65. | SD_BALANCE_EXEC \
  66. | SD_WAKE_AFFINE, \
  67. .last_balance = jiffies, \
  68. .balance_interval = 1, \
  69. .nr_balance_failed = 0, \
  70. }
  71. /* sched_domains SD_NODE_INIT for IA64 NUMA machines */
  72. #define SD_NODE_INIT (struct sched_domain) { \
  73. .span = CPU_MASK_NONE, \
  74. .parent = NULL, \
  75. .groups = NULL, \
  76. .min_interval = 8, \
  77. .max_interval = 8*(min(num_online_cpus(), 32)), \
  78. .busy_factor = 64, \
  79. .imbalance_pct = 125, \
  80. .cache_nice_tries = 2, \
  81. .busy_idx = 3, \
  82. .idle_idx = 2, \
  83. .newidle_idx = 0, /* unused */ \
  84. .wake_idx = 1, \
  85. .forkexec_idx = 1, \
  86. .per_cpu_gain = 100, \
  87. .flags = SD_LOAD_BALANCE \
  88. | SD_BALANCE_EXEC \
  89. | SD_BALANCE_FORK \
  90. | SD_WAKE_BALANCE, \
  91. .last_balance = jiffies, \
  92. .balance_interval = 64, \
  93. .nr_balance_failed = 0, \
  94. }
  95. #endif /* CONFIG_NUMA */
  96. #ifdef CONFIG_SMP
  97. #define topology_physical_package_id(cpu) (cpu_data(cpu)->socket_id)
  98. #define topology_core_id(cpu) (cpu_data(cpu)->core_id)
  99. #define topology_core_siblings(cpu) (cpu_core_map[cpu])
  100. #define topology_thread_siblings(cpu) (cpu_sibling_map[cpu])
  101. #define smt_capable() (smp_num_siblings > 1)
  102. #endif
  103. #include <asm-generic/topology.h>
  104. #endif /* _ASM_IA64_TOPOLOGY_H */