ANDROID: drivers base/arch_topology: provide frequency-invariant accounting support
authorDietmar Eggemann <dietmar.eggemann@arm.com>
Fri, 30 Jun 2017 16:00:23 +0000 (17:00 +0100)
committerChris Redpath <chris.redpath@arm.com>
Thu, 14 Dec 2017 21:41:04 +0000 (21:41 +0000)
commitd283e80e93f47fd67c89599d2ebf6ba264c37586
tree788564eb970a50fd493eaa951215365b23924989
parent768aa8c4c5b0f064367d8f33dd1a1a545a180160
ANDROID: drivers base/arch_topology: provide frequency-invariant accounting support

Implements the arch-specific (arm and arm64) frequency-invariance setter
function arch_set_freq_scale() which provides the following frequency
scaling factor:

  current_freq(cpu) << SCHED_CAPACITY_SHIFT / max_supported_freq(cpu)

One possible consumer of the frequency-invariance getter function
topology_get_freq_scale() is the Per-Entity Load Tracking (PELT)
mechanism of the task scheduler.

Allow inlining of topology_get_freq_scale() into the task scheduler
fast path (e.g. __update_load_avg_se()) by coding it as a static inline
function in the arch topology header file.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Juri Lelli <juri.lelli@arm.com>
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Change-Id: I7a0fadc160d85daf9e35e346391c5d0bb9167d71
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
drivers/base/arch_topology.c
include/linux/arch_topology.h