• Vincent Donnefort's avatar
    PM / EM: Support for inefficient OPPs · 282844c7
    Vincent Donnefort authored and Ionela Voinescu's avatar Ionela Voinescu committed
    Some SoCs, such as the sd855 or the old TC2 have OPPs within the same
    performance domain, whose cost is higher than others with a higher
    frequency. If 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 task placement, and are wasting energy. They are
    Hence, add support for such OPPs to the Energy Model, which creates for
    each OPP a performance state. The Energy Model can now be read using the
    regular table, which contains all performance states available, or using
    an efficient table, where inefficient performance states (and by
    extension, inefficient OPPs) have been removed.
    Currently, the efficient table is used in two paths. Schedutil, that'll
    skip inefficient OPPs for the frequency selection and em_cpu_energy(),
    used by find_energy_efficient_cpu() to estimate the energy cost for a
    specified task placement. We have to modify both paths in the same patch
    so they stay synchronized. The thermal framework still relies on the
    original table and hence, non CPU devices won't create the efficient
    As used in the hot-path, the efficient table is a lookup table, generated
    dynamically when the perf domain is created. The complexity of searching
    a performance state is hence changed from O(n) to O(1). This also
    speeds-up em_cpu_energy() even if no inefficient OPPs have been found.
    Signed-off-by: Vincent Donnefort's avatarVincent Donnefort <vincent.donnefort@arm.com>
energy_model.h 11 KB