Lines Matching +full:performance +full:- +full:domain
1 /* SPDX-License-Identifier: GPL-2.0 */
14 * em_perf_state - Performance state of a performance domain
16 * @power: The power consumed at this level, in milli-watts (by 1 CPU or
29 * em_perf_domain - Performance domain
30 * @table: List of performance states, in ascending order
31 * @nr_perf_states: Number of performance states
32 * @cpus: Cpumask covering the CPUs of the domain. It's here
33 * for performance reasons to avoid potential cache
37 * In case of CPU device, a "performance domain" represents a group of CPUs
38 * whose performance is scaled together. All CPUs of a performance domain
39 * must have the same micro-architecture. Performance domains often have
40 * a 1-to-1 mapping with CPUFreq policies. In case of other devices the @cpus
49 #define em_span_cpus(em) (to_cpumask((em)->cpus))
55 * Increase resolution of energy estimation calculations for 64-bit
57 * task placement when two Performance Domains might provide similar energy
61 * resolution (i.e. 64-bit). The costs for increasing resolution when 32-bit
72 * active_power() - Provide power at the next performance state of
74 * @power : Active power at the performance state in mW
76 * @freq : Frequency at the performance state in kHz
80 * active_power() must find the lowest performance state of 'dev' above
84 * In case of CPUs, the power is the one of a single CPU in the domain,
85 * expressed in milli-watts. It is expected to fit in the
102 * em_cpu_energy() - Estimates the energy consumed by the CPUs of a
103 performance domain
104 * @pd : performance domain for which energy has to be estimated
105 * @max_util : highest utilization among CPUs of the domain
106 * @sum_util : sum of the utilization of all CPUs in the domain
112 * Return: the sum of the energy consumed by the CPUs of the domain assuming
113 * a capacity state satisfying the max utilization of the domain.
123 * In order to predict the performance state, map the utilization of in em_cpu_energy()
124 * the most utilized CPU of the performance domain to a requested in em_cpu_energy()
127 cpu = cpumask_first(to_cpumask(pd->cpus)); in em_cpu_energy()
129 ps = &pd->table[pd->nr_perf_states - 1]; in em_cpu_energy()
130 freq = map_util_freq(max_util, ps->frequency, scale_cpu); in em_cpu_energy()
133 * Find the lowest performance state of the Energy Model above the in em_cpu_energy()
136 for (i = 0; i < pd->nr_perf_states; i++) { in em_cpu_energy()
137 ps = &pd->table[i]; in em_cpu_energy()
138 if (ps->frequency >= freq) in em_cpu_energy()
143 * The capacity of a CPU in the domain at the performance state (ps) in em_cpu_energy()
146 * ps->freq * scale_cpu in em_cpu_energy()
147 * ps->cap = -------------------- (1) in em_cpu_energy()
151 * the EM), the energy consumed by this CPU at that performance state in em_cpu_energy()
154 * ps->power * cpu_util in em_cpu_energy()
155 * cpu_nrg = -------------------- (2) in em_cpu_energy()
156 * ps->cap in em_cpu_energy()
158 * since 'cpu_util / ps->cap' represents its percentage of busy time. in em_cpu_energy()
165 * By injecting (1) in (2), 'cpu_nrg' can be re-expressed as a product in em_cpu_energy()
168 * ps->power * cpu_max_freq cpu_util in em_cpu_energy()
169 * cpu_nrg = ------------------------ * --------- (3) in em_cpu_energy()
170 * ps->freq scale_cpu in em_cpu_energy()
173 * as 'ps->cost'. in em_cpu_energy()
175 * Since all CPUs of the domain have the same micro-architecture, they in em_cpu_energy()
176 * share the same 'ps->cost', and the same CPU capacity. Hence, the in em_cpu_energy()
177 * total energy of the domain (which is the simple sum of the energy of in em_cpu_energy()
180 * ps->cost * \Sum cpu_util in em_cpu_energy()
181 * pd_nrg = ------------------------ (4) in em_cpu_energy()
184 return ps->cost * sum_util / scale_cpu; in em_cpu_energy()
188 * em_pd_nr_perf_states() - Get the number of performance states of a perf.
189 * domain
190 * @pd : performance domain for which this must be done
192 * Return: the number of performance states in the performance domain table
196 return pd->nr_perf_states; in em_pd_nr_perf_states()
207 return -EINVAL; in em_dev_register_perf_domain()