History

PM: EM: Mark inefficient states

Some SoCs, such as the sd855 have OPPs within the same performance domain, whose cost is higher than others with a higher frequency. Even though those OPPs are interesting from a cooling perspective, it makes no sense to use them when the device can run at full capacity. Those OPPs handicap the performance domain, when choosing the most energy-efficient CPU and are wasting energy. They are inefficient. Hence, add support for such OPPs to the Energy Model. The table can now be read skipping inefficient performance states (and by extension, inefficient OPPs).

Vincent Donnefort committed 5 years ago

Commit c8ed9951 parent aa1a4322 files · +15 −1Browse files

Showing the changes to kernel (1 of 2 files). Show all

Unified · Split

kernel/power/energy_model.c+3−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 /*
33 * Energy Model of devices
44 *
5− * Copyright (c) 2018-2020, Arm ltd.
5+ * Copyright (c) 2018-2021, Arm ltd.
66 * Written by: Quentin Perret, Arm ltd.
77 * Improvements provided by: Lukasz Luba, Arm ltd.
88 */
@@ -42,6 +42,7 @@ static void em_debug_create_ps(struct em_perf_state *ps, struct dentry *pd) · 33 unmodified lines
4242 debugfs_create_ulong("frequency", 0444, d, &ps->frequency);
4343 debugfs_create_ulong("power", 0444, d, &ps->power);
4444 debugfs_create_ulong("cost", 0444, d, &ps->cost);
45+ debugfs_create_ulong("inefficient", 0444, d, &ps->flags);
4546 }
4647
4748 static int em_debug_cpus_show(struct seq_file *s, void *unused)
@@ -162,6 +163,7 @@ static int em_create_perf_table(struct device *dev, struct em_perf_domain *pd, · 114 unmodified lines
162163 table[i].cost = div64_u64(fmax * power_res,
163164 table[i].frequency);
164165 if (table[i].cost >= prev_cost) {
166+ table[i].flags = EM_PERF_STATE_INEFFICIENT;
165167 dev_dbg(dev, "EM: OPP:%lu is inefficient\n",
166168 table[i].frequency);
167169 } else {