mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
ACPI / CPPC: add sysfs support to compute delivered performance
The CPPC tables contain entries for per CPU feedback counters which allows us to compute the delivered performance over a given interval of time. The math for delivered performance per the CPPCv5.0+ spec is: reference perf * delta(delivered perf ctr)/delta(ref perf ctr) Maintaining deltas of the counters in the kernel is messy, as it depends on when the reads are triggered. (e.g. via the cpufreq ->get() interface). Also the ->get() interace only returns one value, so cant return raw values. So instead, leave it to userspace to keep track of raw values and do its math for CPUs it cares about. delivered and reference perf counters are exposed via the same sysfs file to avoid the potential "skid", if these values are read individually from userspace. Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org> Signed-off-by: Ashwin Chaugule <ashwin.chaugule@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
be8b88d7d9
commit
158c998ea4
2 changed files with 120 additions and 21 deletions
|
@ -65,6 +65,7 @@ struct cpc_desc {
|
|||
int write_cmd_id;
|
||||
struct cpc_register_resource cpc_regs[MAX_CPC_REG_ENT];
|
||||
struct acpi_psd_package domain_info;
|
||||
struct kobject kobj;
|
||||
};
|
||||
|
||||
/* These are indexes into the per-cpu cpc_regs[]. Order is important. */
|
||||
|
@ -99,7 +100,6 @@ enum cppc_regs {
|
|||
struct cppc_perf_caps {
|
||||
u32 highest_perf;
|
||||
u32 nominal_perf;
|
||||
u32 reference_perf;
|
||||
u32 lowest_perf;
|
||||
};
|
||||
|
||||
|
@ -111,9 +111,9 @@ struct cppc_perf_ctrls {
|
|||
|
||||
struct cppc_perf_fb_ctrs {
|
||||
u64 reference;
|
||||
u64 prev_reference;
|
||||
u64 delivered;
|
||||
u64 prev_delivered;
|
||||
u64 reference_perf;
|
||||
u64 ctr_wrap_time;
|
||||
};
|
||||
|
||||
/* Per CPU container for runtime CPPC management. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue