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).
Showing the changes to kernel (1 of 2 files). Show all
Unified · Split
| @@ -2,7 +2,7 @@ · 1 unmodified line | |||
| 2 | /* | 2 | /* |
| 3 | * Energy Model of devices | 3 | * Energy Model of devices |
| 4 | * | 4 | * |
| 5 | * Copyright (c) 2018-2020, Arm ltd. | 5 | * Copyright (c) 2018-2021, Arm ltd. |
| 6 | * Written by: Quentin Perret, Arm ltd. | 6 | * Written by: Quentin Perret, Arm ltd. |
| 7 | * Improvements provided by: Lukasz Luba, Arm ltd. | 7 | * Improvements provided by: Lukasz Luba, Arm ltd. |
| 8 | */ | 8 | */ |
| @@ -42,6 +42,7 @@ static void em_debug_create_ps(struct em_perf_state *ps, struct dentry *pd) · 33 unmodified lines | |||
| 42 | debugfs_create_ulong("frequency", 0444, d, &ps->frequency); | 42 | debugfs_create_ulong("frequency", 0444, d, &ps->frequency); |
| 43 | debugfs_create_ulong("power", 0444, d, &ps->power); | 43 | debugfs_create_ulong("power", 0444, d, &ps->power); |
| 44 | debugfs_create_ulong("cost", 0444, d, &ps->cost); | 44 | debugfs_create_ulong("cost", 0444, d, &ps->cost); |
| 45 | debugfs_create_ulong("inefficient", 0444, d, &ps->flags); | ||
| 45 | } | 46 | } |
| 46 | 47 | ||
| 47 | static int em_debug_cpus_show(struct seq_file *s, void *unused) | 48 | 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 | |||
| 162 | table[i].cost = div64_u64(fmax * power_res, | 163 | table[i].cost = div64_u64(fmax * power_res, |
| 163 | table[i].frequency); | 164 | table[i].frequency); |
| 164 | if (table[i].cost >= prev_cost) { | 165 | if (table[i].cost >= prev_cost) { |
| 166 | table[i].flags = EM_PERF_STATE_INEFFICIENT; | ||
| 165 | dev_dbg(dev, "EM: OPP:%lu is inefficient\n", | 167 | dev_dbg(dev, "EM: OPP:%lu is inefficient\n", |
| 166 | table[i].frequency); | 168 | table[i].frequency); |
| 167 | } else { | 169 | } else { |