Lines Matching +full:cpu +full:- +full:capacity

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
18 * @power: The power consumed at this level (by 1 CPU or by a registered
43 * struct em_perf_table - Performance states table
55 * struct em_perf_domain - Performance domain
66 * In case of CPU device, a "performance domain" represents a group of CPUs
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
122 * active_power() - Provide power at the next performance state of
124 * @dev : Device for which we do this operation (can be a CPU)
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
146 * @dev : Device for which we do this operation (can be a CPU)
151 * In case of CPUs, the cost is the one of a single CPU in the domain.
167 struct em_perf_domain *em_cpu_get(int cpu);
185 * em_pd_get_efficient_state() - Get an efficient performance state from the EM
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
225 * @allowed_cpu_cap : maximum allowed CPU capacity for the @pd, which
228 * This function must be used only for CPU devices. There is no validation,
229 * i.e. if the EM is a CPU type and has cpumask allocated. It is called from
233 * a capacity state satisfying the max utilization of the domain.
252 * the most utilized CPU of the performance domain to a requested in em_cpu_energy()
255 * max utilization to the allowed CPU capacity before calculating 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()
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.
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.
338 return rcu_dereference(pd->em_table)->state; in em_perf_state_from_pd()
352 return -EINVAL; in em_dev_register_perf_domain()
357 static inline struct em_perf_domain *em_cpu_get(int cpu) in em_cpu_get() argument
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()