Skip to content

Commit f1a5049

Browse files
ricardonrafaeljw
authored andcommitted
cpufreq: intel_pstate: Populate the cpu_capacity sysfs entries
Intel hybrid processors have CPUs of different capacity. Populate the interface /sys/devices/system/cpu/cpuN/cpu_capacity. This interface uses the per-CPU variable `cpu_scale`. On x86 this variable has no other use besides feeding the sysfs entries. Initialize it when setting CPU capacity for the scheduler and scale-invariant code. Feed it with arch_scale_cpu_capacity() as it gives capacity normalized to the interval [0, SCHED_CAPACITY_SCALE]. Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 6bceea7 commit f1a5049

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/cpufreq/intel_pstate.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,8 @@ static void hybrid_set_cpu_capacity(struct cpudata *cpu)
955955
cpu->capacity_perf,
956956
cpu->pstate.max_pstate_physical);
957957

958+
topology_set_cpu_scale(cpu->cpu, arch_scale_cpu_capacity(cpu->cpu));
959+
958960
pr_debug("CPU%d: perf = %u, max. perf = %u, base perf = %d\n", cpu->cpu,
959961
cpu->capacity_perf, hybrid_max_perf_cpu->capacity_perf,
960962
cpu->pstate.max_pstate_physical);

0 commit comments

Comments
 (0)