• Ashwin Chaugule's avatar
    ACPI / CPPC: add sysfs support to compute delivered performance · 158c998e
    Ashwin Chaugule authored
    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: default avatarPrashanth Prakash <pprakash@codeaurora.org>
    Signed-off-by: default avatarAshwin Chaugule <ashwin.chaugule@linaro.org>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    158c998e
cppc_acpi.c 33.3 KB