aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/topology.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/topology.h')
-rw-r--r--include/linux/topology.h168
1 files changed, 95 insertions, 73 deletions
diff --git a/include/linux/topology.h b/include/linux/topology.h
index 7402c1a27c4f..fc0bf3edeb67 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -85,20 +85,27 @@ int arch_update_cpu_topology(void);
85#define ARCH_HAS_SCHED_WAKE_IDLE 85#define ARCH_HAS_SCHED_WAKE_IDLE
86/* Common values for SMT siblings */ 86/* Common values for SMT siblings */
87#ifndef SD_SIBLING_INIT 87#ifndef SD_SIBLING_INIT
88#define SD_SIBLING_INIT (struct sched_domain) { \ 88#define SD_SIBLING_INIT (struct sched_domain) { \
89 .min_interval = 1, \ 89 .min_interval = 1, \
90 .max_interval = 2, \ 90 .max_interval = 2, \
91 .busy_factor = 64, \ 91 .busy_factor = 64, \
92 .imbalance_pct = 110, \ 92 .imbalance_pct = 110, \
93 .flags = SD_LOAD_BALANCE \ 93 \
94 | SD_BALANCE_NEWIDLE \ 94 .flags = 1*SD_LOAD_BALANCE \
95 | SD_BALANCE_FORK \ 95 | 1*SD_BALANCE_NEWIDLE \
96 | SD_BALANCE_EXEC \ 96 | 1*SD_BALANCE_EXEC \
97 | SD_WAKE_AFFINE \ 97 | 1*SD_BALANCE_FORK \
98 | SD_WAKE_BALANCE \ 98 | 0*SD_BALANCE_WAKE \
99 | SD_SHARE_CPUPOWER, \ 99 | 1*SD_WAKE_AFFINE \
100 .last_balance = jiffies, \ 100 | 1*SD_SHARE_CPUPOWER \
101 .balance_interval = 1, \ 101 | 0*SD_POWERSAVINGS_BALANCE \
102 | 0*SD_SHARE_PKG_RESOURCES \
103 | 0*SD_SERIALIZE \
104 | 0*SD_PREFER_SIBLING \
105 , \
106 .last_balance = jiffies, \
107 .balance_interval = 1, \
108 .smt_gain = 1178, /* 15% */ \
102} 109}
103#endif 110#endif
104#endif /* CONFIG_SCHED_SMT */ 111#endif /* CONFIG_SCHED_SMT */
@@ -106,69 +113,90 @@ int arch_update_cpu_topology(void);
106#ifdef CONFIG_SCHED_MC 113#ifdef CONFIG_SCHED_MC
107/* Common values for MC siblings. for now mostly derived from SD_CPU_INIT */ 114/* Common values for MC siblings. for now mostly derived from SD_CPU_INIT */
108#ifndef SD_MC_INIT 115#ifndef SD_MC_INIT
109#define SD_MC_INIT (struct sched_domain) { \ 116#define SD_MC_INIT (struct sched_domain) { \
110 .min_interval = 1, \ 117 .min_interval = 1, \
111 .max_interval = 4, \ 118 .max_interval = 4, \
112 .busy_factor = 64, \ 119 .busy_factor = 64, \
113 .imbalance_pct = 125, \ 120 .imbalance_pct = 125, \
114 .cache_nice_tries = 1, \ 121 .cache_nice_tries = 1, \
115 .busy_idx = 2, \ 122 .busy_idx = 2, \
116 .wake_idx = 1, \ 123 .wake_idx = 0, \
117 .forkexec_idx = 1, \ 124 .forkexec_idx = 0, \
118 .flags = SD_LOAD_BALANCE \ 125 \
119 | SD_BALANCE_FORK \ 126 .flags = 1*SD_LOAD_BALANCE \
120 | SD_BALANCE_EXEC \ 127 | 1*SD_BALANCE_NEWIDLE \
121 | SD_WAKE_AFFINE \ 128 | 1*SD_BALANCE_EXEC \
122 | SD_WAKE_BALANCE \ 129 | 1*SD_BALANCE_FORK \
123 | SD_SHARE_PKG_RESOURCES\ 130 | 0*SD_BALANCE_WAKE \
124 | sd_balance_for_mc_power()\ 131 | 1*SD_WAKE_AFFINE \
125 | sd_power_saving_flags(),\ 132 | 1*SD_PREFER_LOCAL \
126 .last_balance = jiffies, \ 133 | 0*SD_SHARE_CPUPOWER \
127 .balance_interval = 1, \ 134 | 1*SD_SHARE_PKG_RESOURCES \
135 | 0*SD_SERIALIZE \
136 | sd_balance_for_mc_power() \
137 | sd_power_saving_flags() \
138 , \
139 .last_balance = jiffies, \
140 .balance_interval = 1, \
128} 141}
129#endif 142#endif
130#endif /* CONFIG_SCHED_MC */ 143#endif /* CONFIG_SCHED_MC */
131 144
132/* Common values for CPUs */ 145/* Common values for CPUs */
133#ifndef SD_CPU_INIT 146#ifndef SD_CPU_INIT
134#define SD_CPU_INIT (struct sched_domain) { \ 147#define SD_CPU_INIT (struct sched_domain) { \
135 .min_interval = 1, \ 148 .min_interval = 1, \
136 .max_interval = 4, \ 149 .max_interval = 4, \
137 .busy_factor = 64, \ 150 .busy_factor = 64, \
138 .imbalance_pct = 125, \ 151 .imbalance_pct = 125, \
139 .cache_nice_tries = 1, \ 152 .cache_nice_tries = 1, \
140 .busy_idx = 2, \ 153 .busy_idx = 2, \
141 .idle_idx = 1, \ 154 .idle_idx = 1, \
142 .newidle_idx = 2, \ 155 .newidle_idx = 0, \
143 .wake_idx = 1, \ 156 .wake_idx = 0, \
144 .forkexec_idx = 1, \ 157 .forkexec_idx = 0, \
145 .flags = SD_LOAD_BALANCE \ 158 \
146 | SD_BALANCE_EXEC \ 159 .flags = 1*SD_LOAD_BALANCE \
147 | SD_BALANCE_FORK \ 160 | 1*SD_BALANCE_NEWIDLE \
148 | SD_WAKE_AFFINE \ 161 | 1*SD_BALANCE_EXEC \
149 | SD_WAKE_BALANCE \ 162 | 1*SD_BALANCE_FORK \
150 | sd_balance_for_package_power()\ 163 | 0*SD_BALANCE_WAKE \
151 | sd_power_saving_flags(),\ 164 | 1*SD_WAKE_AFFINE \
152 .last_balance = jiffies, \ 165 | 1*SD_PREFER_LOCAL \
153 .balance_interval = 1, \ 166 | 0*SD_SHARE_CPUPOWER \
167 | 0*SD_SHARE_PKG_RESOURCES \
168 | 0*SD_SERIALIZE \
169 | sd_balance_for_package_power() \
170 | sd_power_saving_flags() \
171 , \
172 .last_balance = jiffies, \
173 .balance_interval = 1, \
154} 174}
155#endif 175#endif
156 176
157/* sched_domains SD_ALLNODES_INIT for NUMA machines */ 177/* sched_domains SD_ALLNODES_INIT for NUMA machines */
158#define SD_ALLNODES_INIT (struct sched_domain) { \ 178#define SD_ALLNODES_INIT (struct sched_domain) { \
159 .min_interval = 64, \ 179 .min_interval = 64, \
160 .max_interval = 64*num_online_cpus(), \ 180 .max_interval = 64*num_online_cpus(), \
161 .busy_factor = 128, \ 181 .busy_factor = 128, \
162 .imbalance_pct = 133, \ 182 .imbalance_pct = 133, \
163 .cache_nice_tries = 1, \ 183 .cache_nice_tries = 1, \
164 .busy_idx = 3, \ 184 .busy_idx = 3, \
165 .idle_idx = 3, \ 185 .idle_idx = 3, \
166 .flags = SD_LOAD_BALANCE \ 186 .flags = 1*SD_LOAD_BALANCE \
167 | SD_BALANCE_NEWIDLE \ 187 | 1*SD_BALANCE_NEWIDLE \
168 | SD_WAKE_AFFINE \ 188 | 0*SD_BALANCE_EXEC \
169 | SD_SERIALIZE, \ 189 | 0*SD_BALANCE_FORK \
170 .last_balance = jiffies, \ 190 | 0*SD_BALANCE_WAKE \
171 .balance_interval = 64, \ 191 | 0*SD_WAKE_AFFINE \
192 | 0*SD_SHARE_CPUPOWER \
193 | 0*SD_POWERSAVINGS_BALANCE \
194 | 0*SD_SHARE_PKG_RESOURCES \
195 | 1*SD_SERIALIZE \
196 | 0*SD_PREFER_SIBLING \
197 , \
198 .last_balance = jiffies, \
199 .balance_interval = 64, \
172} 200}
173 201
174#ifdef CONFIG_NUMA 202#ifdef CONFIG_NUMA
@@ -183,12 +211,6 @@ int arch_update_cpu_topology(void);
183#ifndef topology_core_id 211#ifndef topology_core_id
184#define topology_core_id(cpu) ((void)(cpu), 0) 212#define topology_core_id(cpu) ((void)(cpu), 0)
185#endif 213#endif
186#ifndef topology_thread_siblings
187#define topology_thread_siblings(cpu) cpumask_of_cpu(cpu)
188#endif
189#ifndef topology_core_siblings
190#define topology_core_siblings(cpu) cpumask_of_cpu(cpu)
191#endif
192#ifndef topology_thread_cpumask 214#ifndef topology_thread_cpumask
193#define topology_thread_cpumask(cpu) cpumask_of(cpu) 215#define topology_thread_cpumask(cpu) cpumask_of(cpu)
194#endif 216#endif