Lines Matching +full:performance +full:- +full:domain
1 .. SPDX-License-Identifier: GPL-2.0
8 -----------
11 the power consumed by devices at various performance levels, and the kernel
12 subsystems willing to use that information to make energy-aware decisions.
18 each and every client subsystem to re-implement support for each and every
23 The power values might be expressed in micro-Watts or in an 'abstract scale'.
26 can be found in the Energy-Aware Scheduler documentation
27 Documentation/scheduler/sched-energy.rst. For some subsystems like thermal or
30 thus the real micro-Watts might be needed. An example of these requirements can
32 Documentation/driver-api/thermal/power_allocator.rst.
36 an 'abstract scale' deriving real energy in micro-Joules would not be possible.
38 The figure below depicts an example of drivers (Arm-specific here, but the
42 +---------------+ +-----------------+ +---------------+
44 +---------------+ +-----------------+ +---------------+
47 +---------+ | +---------+
50 +---------------------+
53 +---------------------+
56 +----------+ | +---------+
58 +---------------+ +---------------+ +--------------+
59 | cpufreq-dt | | arm_scmi | | Other |
60 +---------------+ +---------------+ +--------------+
63 +--------------+ +---------------+ +--------------+
65 +--------------+ +---------------+ +--------------+
68 'performance domain' in the system. A performance domain is a group of CPUs
69 whose performance is scaled together. Performance domains generally have a
70 1-to-1 mapping with CPUFreq policies. All CPUs in a performance domain are
71 required to have the same micro-architecture. CPUs in different performance
72 domains can have different micro-architectures.
83 framework will handle the clean-up when it's possible.
94 It is possible also to modify the CPU performance values for each EM's
95 performance state. Thus, the full power and performance profile (which
101 ------------
109 2.2 Registration of performance domains
118 the real power measurements performed for each performance state. Thus, this
122 Drivers are expected to register performance domains into the EM framework by
129 for each performance state. The callback function provided by the driver is free
132 performance domains using cpumask. For other devices than CPUs the last
145 "operating-points-v2". Each OPP entry in DT can be extended with a property
146 "opp-microwatt" containing micro-Watts power value. This OPP DT property
155 knowledge about power value for each performance state. The callback
184 2.3 Accessing performance domains
191 performance domain.
195 the performance domains, and kept in memory untouched.
197 The energy consumed by a performance domain can be estimated using the
217 contains array 'struct em_perf_state state[]' which is a list of performance
230 and will be visible to other sub-systems in the kernel (thermal, powercap).
232 or memory allocations at runtime. When pre-computed EMs are available in the
233 device driver, than it should be possible to simply re-use them with low
234 performance overhead.
242 no other sub-system using it, e.g. EAS.
244 To use the power values in other sub-systems (like thermal, powercap) there is
250 It returns the 'struct em_perf_state' pointer which is an array of performance
268 The function takes care for right setting of inefficiency for each performance
280 .. kernel-doc:: include/linux/energy_model.h
283 .. kernel-doc:: kernel/power/energy_model.c
288 -----------
298 performance domain in the Energy Model framework using the (fake) 'foo'
302 -> drivers/cpufreq/foo_cpufreq.c
332 29 cpu_dev = get_cpu_device(cpumask_first(policy->cpus));
337 34 /* And register the new performance domain */
338 35 em_dev_register_perf_domain(cpu_dev, nr_opp, &em_cb, policy->cpus,
354 -> drivers/soc/example/example_em_mod.c
360 05 struct device *dev = ctx->dev;
373 18 new_table = em_table->state;
377 22 for (i = 0; i < pd->nr_perf_states; i++) {
384 29 ret = em_dev_compute_costs(dev, table, pd->nr_perf_states);
399 44 * Since it's one-time-update drop the usage counter.
411 56 struct device *dev = ctx->dev;
414 59 ctx->temperature = foo_get_temp(dev, ctx);
415 60 if (ctx->temperature < FOO_EM_UPDATE_TEMP_THRESHOLD)