Lines Matching +full:performance +full:- +full:domain

1 /* SPDX-License-Identifier: GPL-2.0 */
15 * struct em_perf_state - Performance state of a performance domain
16 * @performance: CPU performance (capacity) at a given frequency
25 unsigned long performance; member
35 * EM_PERF_STATE_INEFFICIENT: The performance state is inefficient. There is
36 * in this em_perf_domain, another performance state with a higher frequency
43 * struct em_perf_table - Performance states table
46 * @state: List of performance states, in ascending order
55 * struct em_perf_domain - Performance domain
57 * @nr_perf_states: Number of performance states
58 * @min_perf_state: Minimum allowed Performance State index
59 * @max_perf_state: Maximum allowed Performance State index
61 * @cpus: Cpumask covering the CPUs of the domain. It's here
62 * for performance reasons to avoid potential cache
66 * In case of CPU device, a "performance domain" represents a group of CPUs
67 * whose performance is scaled together. All CPUs of a performance domain
68 * must have the same micro-architecture. Performance domains often have
69 * a 1-to-1 mapping with CPUFreq policies. In case of other devices the @cpus
84 * EM_PERF_DOMAIN_MICROWATTS: The power values are in micro-Watts or some
97 #define em_span_cpus(em) (to_cpumask((em)->cpus))
98 #define em_is_artificial(em) ((em)->flags & EM_PERF_DOMAIN_ARTIFICIAL)
102 * The max power value in micro-Watts. The limit of 64 Watts is set as
104 * 32bit value limit for total Perf Domain power implies a limit of
105 * maximum CPUs in such domain to 64.
111 * limits to number of CPUs in the Perf. Domain.
122 * active_power() - Provide power at the next performance state of
125 * @power : Active power at the performance state
127 * @freq : Frequency at the performance state in kHz
130 * active_power() must find the lowest performance state of 'dev' above
134 * In case of CPUs, the power is the one of a single CPU in the domain,
135 * expressed in micro-Watts or an abstract scale. It is expected to
144 * get_cost() - Provide the cost at the given performance state of
147 * @freq : Frequency at the performance state in kHz
148 * @cost : The cost value for the performance state
151 * In case of CPUs, the cost is the one of a single CPU in the domain.
185 * em_pd_get_efficient_state() - Get an efficient performance state from the EM
186 * @table: List of performance states, in ascending order
187 * @pd: performance domain for which this must be done
193 * Return: An efficient performance state id, high enough to meet @max_util
200 unsigned long pd_flags = pd->flags; in em_pd_get_efficient_state()
201 int min_ps = pd->min_perf_state; in em_pd_get_efficient_state()
202 int max_ps = pd->max_perf_state; in em_pd_get_efficient_state()
208 if (ps->performance >= max_util) { in em_pd_get_efficient_state()
210 ps->flags & EM_PERF_STATE_INEFFICIENT) in em_pd_get_efficient_state()
220 * em_cpu_energy() - Estimates the energy consumed by the CPUs of a
221 * performance domain
222 * @pd : performance domain for which energy has to be estimated
223 * @max_util : highest utilization among CPUs of the domain
224 * @sum_util : sum of the utilization of all CPUs in the domain
232 * Return: the sum of the energy consumed by the CPUs of the domain assuming
233 * a capacity state satisfying the max utilization of the domain.
251 * In order to predict the performance state, map the utilization of in em_cpu_energy()
252 * the most utilized CPU of the performance domain to a requested in em_cpu_energy()
253 * performance, like schedutil. Take also into account that the real in em_cpu_energy()
254 * performance might be set lower (due to thermal capping). Thus, clamp in em_cpu_energy()
256 * effective performance. in em_cpu_energy()
261 * Find the lowest performance state of the Energy Model above the in em_cpu_energy()
262 * requested performance. in em_cpu_energy()
264 em_table = rcu_dereference(pd->em_table); in em_cpu_energy()
265 i = em_pd_get_efficient_state(em_table->state, pd, max_util); in em_cpu_energy()
266 ps = &em_table->state[i]; in em_cpu_energy()
269 * The performance (capacity) of a CPU in the domain at the performance in em_cpu_energy()
272 * ps->freq * scale_cpu in em_cpu_energy()
273 * ps->performance = -------------------- (1) in em_cpu_energy()
277 * the EM), the energy consumed by this CPU at that performance state in em_cpu_energy()
280 * ps->power * cpu_util in em_cpu_energy()
281 * cpu_nrg = -------------------- (2) in em_cpu_energy()
282 * ps->performance in em_cpu_energy()
284 * since 'cpu_util / ps->performance' represents its percentage of busy in em_cpu_energy()
292 * By injecting (1) in (2), 'cpu_nrg' can be re-expressed as a product in em_cpu_energy()
295 * ps->power * cpu_max_freq in em_cpu_energy()
296 * cpu_nrg = ------------------------ * cpu_util (3) in em_cpu_energy()
297 * ps->freq * scale_cpu in em_cpu_energy()
300 * as 'ps->cost'. in em_cpu_energy()
302 * Since all CPUs of the domain have the same micro-architecture, they in em_cpu_energy()
303 * share the same 'ps->cost', and the same CPU capacity. Hence, the in em_cpu_energy()
304 * total energy of the domain (which is the simple sum of the energy of in em_cpu_energy()
307 * pd_nrg = ps->cost * \Sum cpu_util (4) in em_cpu_energy()
309 return ps->cost * sum_util; in em_cpu_energy()
313 * em_pd_nr_perf_states() - Get the number of performance states of a perf.
314 * domain
315 * @pd : performance domain for which this must be done
317 * Return: the number of performance states in the performance domain table
321 return pd->nr_perf_states; in em_pd_nr_perf_states()
325 * em_perf_state_from_pd() - Get the performance states table of perf.
326 * domain
327 * @pd : performance domain for which this must be done
330 * of the performance states table is finished, the rcu_read_unlock() should
333 * Return: the pointer to performance states table of the performance domain
338 return rcu_dereference(pd->em_table)->state; in em_perf_state_from_pd()
352 return -EINVAL; in em_dev_register_perf_domain()
385 return -EINVAL; in em_dev_update_perf_domain()
396 return -EINVAL; in em_dev_compute_costs()
400 return -EINVAL; in em_dev_update_chip_binning()
406 return -EINVAL; in em_update_performance_limits()