aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/topology.h47
-rw-r--r--include/linux/topology.h169
2 files changed, 129 insertions, 87 deletions
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index 066ef590d7e0..be29eb81fb06 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -129,25 +129,34 @@ extern unsigned long node_remap_size[];
129#endif 129#endif
130 130
131/* sched_domains SD_NODE_INIT for NUMA machines */ 131/* sched_domains SD_NODE_INIT for NUMA machines */
132#define SD_NODE_INIT (struct sched_domain) { \ 132#define SD_NODE_INIT (struct sched_domain) { \
133 .min_interval = 8, \ 133 .min_interval = 8, \
134 .max_interval = 32, \ 134 .max_interval = 32, \
135 .busy_factor = 32, \ 135 .busy_factor = 32, \
136 .imbalance_pct = 125, \ 136 .imbalance_pct = 125, \
137 .cache_nice_tries = SD_CACHE_NICE_TRIES, \ 137 .cache_nice_tries = SD_CACHE_NICE_TRIES, \
138 .busy_idx = 3, \ 138 .busy_idx = 3, \
139 .idle_idx = SD_IDLE_IDX, \ 139 .idle_idx = SD_IDLE_IDX, \
140 .newidle_idx = SD_NEWIDLE_IDX, \ 140 .newidle_idx = SD_NEWIDLE_IDX, \
141 .wake_idx = 1, \ 141 .wake_idx = 1, \
142 .forkexec_idx = SD_FORKEXEC_IDX, \ 142 .forkexec_idx = SD_FORKEXEC_IDX, \
143 .flags = SD_LOAD_BALANCE \ 143 \
144 | SD_BALANCE_EXEC \ 144 .flags = 1*SD_LOAD_BALANCE \
145 | SD_BALANCE_FORK \ 145 | 0*SD_BALANCE_NEWIDLE \
146 | SD_WAKE_AFFINE \ 146 | 1*SD_BALANCE_EXEC \
147 | SD_WAKE_BALANCE \ 147 | 1*SD_BALANCE_FORK \
148 | SD_SERIALIZE, \ 148 | 0*SD_WAKE_IDLE \
149 .last_balance = jiffies, \ 149 | 1*SD_WAKE_AFFINE \
150 .balance_interval = 1, \ 150 | 1*SD_WAKE_BALANCE \
151 | 0*SD_SHARE_CPUPOWER \
152 | 0*SD_POWERSAVINGS_BALANCE \
153 | 0*SD_SHARE_PKG_RESOURCES \
154 | 1*SD_SERIALIZE \
155 | 0*SD_WAKE_IDLE_FAR \
156 | 0*SD_PREFER_SIBLING \
157 , \
158 .last_balance = jiffies, \
159 .balance_interval = 1, \
151} 160}
152 161
153#ifdef CONFIG_X86_64_ACPI_NUMA 162#ifdef CONFIG_X86_64_ACPI_NUMA
diff --git a/include/linux/topology.h b/include/linux/topology.h
index 6203ae5067ce..fe2c0329f82f 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -85,21 +85,29 @@ 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_WAKE_IDLE \
99 | SD_SHARE_CPUPOWER, \ 99 | 1*SD_WAKE_AFFINE \
100 .last_balance = jiffies, \ 100 | 1*SD_WAKE_BALANCE \
101 .balance_interval = 1, \ 101 | 1*SD_SHARE_CPUPOWER \
102 .smt_gain = 1178, /* 15% */ \ 102 | 0*SD_POWERSAVINGS_BALANCE \
103 | 0*SD_SHARE_PKG_RESOURCES \
104 | 0*SD_SERIALIZE \
105 | 0*SD_WAKE_IDLE_FAR \
106 | 0*SD_PREFER_SIBLING \
107 , \
108 .last_balance = jiffies, \
109 .balance_interval = 1, \
110 .smt_gain = 1178, /* 15% */ \
103} 111}
104#endif 112#endif
105#endif /* CONFIG_SCHED_SMT */ 113#endif /* CONFIG_SCHED_SMT */
@@ -107,69 +115,94 @@ int arch_update_cpu_topology(void);
107#ifdef CONFIG_SCHED_MC 115#ifdef CONFIG_SCHED_MC
108/* Common values for MC siblings. for now mostly derived from SD_CPU_INIT */ 116/* Common values for MC siblings. for now mostly derived from SD_CPU_INIT */
109#ifndef SD_MC_INIT 117#ifndef SD_MC_INIT
110#define SD_MC_INIT (struct sched_domain) { \ 118#define SD_MC_INIT (struct sched_domain) { \
111 .min_interval = 1, \ 119 .min_interval = 1, \
112 .max_interval = 4, \ 120 .max_interval = 4, \
113 .busy_factor = 64, \ 121 .busy_factor = 64, \
114 .imbalance_pct = 125, \ 122 .imbalance_pct = 125, \
115 .cache_nice_tries = 1, \ 123 .cache_nice_tries = 1, \
116 .busy_idx = 2, \ 124 .busy_idx = 2, \
117 .wake_idx = 1, \ 125 .wake_idx = 1, \
118 .forkexec_idx = 1, \ 126 .forkexec_idx = 1, \
119 .flags = SD_LOAD_BALANCE \ 127 \
120 | SD_BALANCE_FORK \ 128 .flags = 1*SD_LOAD_BALANCE \
121 | SD_BALANCE_EXEC \ 129 | 0*SD_BALANCE_NEWIDLE \
122 | SD_WAKE_AFFINE \ 130 | 1*SD_BALANCE_EXEC \
123 | SD_WAKE_BALANCE \ 131 | 1*SD_BALANCE_FORK \
124 | SD_SHARE_PKG_RESOURCES\ 132 | 0*SD_WAKE_IDLE \
125 | sd_balance_for_mc_power()\ 133 | 1*SD_WAKE_AFFINE \
126 | sd_power_saving_flags(),\ 134 | 1*SD_WAKE_BALANCE \
127 .last_balance = jiffies, \ 135 | 0*SD_SHARE_CPUPOWER \
128 .balance_interval = 1, \ 136 | 1*SD_SHARE_PKG_RESOURCES \
137 | 0*SD_SERIALIZE \
138 | 0*SD_WAKE_IDLE_FAR \
139 | sd_balance_for_mc_power() \
140 | sd_power_saving_flags() \
141 , \
142 .last_balance = jiffies, \
143 .balance_interval = 1, \
129} 144}
130#endif 145#endif
131#endif /* CONFIG_SCHED_MC */ 146#endif /* CONFIG_SCHED_MC */
132 147
133/* Common values for CPUs */ 148/* Common values for CPUs */
134#ifndef SD_CPU_INIT 149#ifndef SD_CPU_INIT
135#define SD_CPU_INIT (struct sched_domain) { \ 150#define SD_CPU_INIT (struct sched_domain) { \
136 .min_interval = 1, \ 151 .min_interval = 1, \
137 .max_interval = 4, \ 152 .max_interval = 4, \
138 .busy_factor = 64, \ 153 .busy_factor = 64, \
139 .imbalance_pct = 125, \ 154 .imbalance_pct = 125, \
140 .cache_nice_tries = 1, \ 155 .cache_nice_tries = 1, \
141 .busy_idx = 2, \ 156 .busy_idx = 2, \
142 .idle_idx = 1, \ 157 .idle_idx = 1, \
143 .newidle_idx = 2, \ 158 .newidle_idx = 2, \
144 .wake_idx = 1, \ 159 .wake_idx = 1, \
145 .forkexec_idx = 1, \ 160 .forkexec_idx = 1, \
146 .flags = SD_LOAD_BALANCE \ 161 \
147 | SD_BALANCE_EXEC \ 162 .flags = 1*SD_LOAD_BALANCE \
148 | SD_BALANCE_FORK \ 163 | 0*SD_BALANCE_NEWIDLE \
149 | SD_WAKE_AFFINE \ 164 | 1*SD_BALANCE_EXEC \
150 | SD_WAKE_BALANCE \ 165 | 1*SD_BALANCE_FORK \
151 | sd_balance_for_package_power()\ 166 | 0*SD_WAKE_IDLE \
152 | sd_power_saving_flags(),\ 167 | 0*SD_WAKE_AFFINE \
153 .last_balance = jiffies, \ 168 | 1*SD_WAKE_BALANCE \
154 .balance_interval = 1, \ 169 | 0*SD_SHARE_CPUPOWER \
170 | 0*SD_SHARE_PKG_RESOURCES \
171 | 0*SD_SERIALIZE \
172 | 0*SD_WAKE_IDLE_FAR \
173 | sd_balance_for_package_power() \
174 | sd_power_saving_flags() \
175 , \
176 .last_balance = jiffies, \
177 .balance_interval = 1, \
155} 178}
156#endif 179#endif
157 180
158/* sched_domains SD_ALLNODES_INIT for NUMA machines */ 181/* sched_domains SD_ALLNODES_INIT for NUMA machines */
159#define SD_ALLNODES_INIT (struct sched_domain) { \ 182#define SD_ALLNODES_INIT (struct sched_domain) { \
160 .min_interval = 64, \ 183 .min_interval = 64, \
161 .max_interval = 64*num_online_cpus(), \ 184 .max_interval = 64*num_online_cpus(), \
162 .busy_factor = 128, \ 185 .busy_factor = 128, \
163 .imbalance_pct = 133, \ 186 .imbalance_pct = 133, \
164 .cache_nice_tries = 1, \ 187 .cache_nice_tries = 1, \
165 .busy_idx = 3, \ 188 .busy_idx = 3, \
166 .idle_idx = 3, \ 189 .idle_idx = 3, \
167 .flags = SD_LOAD_BALANCE \ 190 .flags = 1*SD_LOAD_BALANCE \
168 | SD_BALANCE_NEWIDLE \ 191 | 1*SD_BALANCE_NEWIDLE \
169 | SD_WAKE_AFFINE \ 192 | 0*SD_BALANCE_EXEC \
170 | SD_SERIALIZE, \ 193 | 0*SD_BALANCE_FORK \
171 .last_balance = jiffies, \ 194 | 0*SD_WAKE_IDLE \
172 .balance_interval = 64, \ 195 | 1*SD_WAKE_AFFINE \
196 | 0*SD_WAKE_BALANCE \
197 | 0*SD_SHARE_CPUPOWER \
198 | 0*SD_POWERSAVINGS_BALANCE \
199 | 0*SD_SHARE_PKG_RESOURCES \
200 | 1*SD_SERIALIZE \
201 | 0*SD_WAKE_IDLE_FAR \
202 | 0*SD_PREFER_SIBLING \
203 , \
204 .last_balance = jiffies, \
205 .balance_interval = 64, \
173} 206}
174 207
175#ifdef CONFIG_NUMA 208#ifdef CONFIG_NUMA