Skip to content

Commit 5313ec4

Browse files
committed
cpufreq: intel_pstate: Improve printing of debug messages
Some debug messages generated by intel_pstate on a given hybrid system are only printed for some CPUs which is confusing, so modify the driver to print them for all CPUs. Also change those messages to avoid printing local variable names in them. Moreover, some debug messages printed by intel_pstate are quite hard to understand without looking at the code printing them, so make them somewhat clearer while at it. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/8609836.T7Z3S40VBb@rafael.j.wysocki
1 parent d852b6f commit 5313ec4

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

drivers/cpufreq/intel_pstate.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -575,13 +575,18 @@ static void intel_pstate_hybrid_hwp_adjust(struct cpudata *cpu)
575575
int scaling = cpu->pstate.scaling;
576576
int freq;
577577

578-
pr_debug("CPU%d: perf_ctl_max_phys = %d\n", cpu->cpu, perf_ctl_max_phys);
579-
pr_debug("CPU%d: perf_ctl_turbo = %d\n", cpu->cpu, perf_ctl_turbo);
580-
pr_debug("CPU%d: perf_ctl_scaling = %d\n", cpu->cpu, perf_ctl_scaling);
578+
pr_debug("CPU%d: PERF_CTL max_phys = %d\n", cpu->cpu, perf_ctl_max_phys);
579+
pr_debug("CPU%d: PERF_CTL turbo = %d\n", cpu->cpu, perf_ctl_turbo);
580+
pr_debug("CPU%d: PERF_CTL scaling = %d\n", cpu->cpu, perf_ctl_scaling);
581581
pr_debug("CPU%d: HWP_CAP guaranteed = %d\n", cpu->cpu, cpu->pstate.max_pstate);
582582
pr_debug("CPU%d: HWP_CAP highest = %d\n", cpu->cpu, cpu->pstate.turbo_pstate);
583583
pr_debug("CPU%d: HWP-to-frequency scaling factor: %d\n", cpu->cpu, scaling);
584584

585+
if (scaling == perf_ctl_scaling)
586+
return;
587+
588+
hwp_is_hybrid = true;
589+
585590
cpu->pstate.turbo_freq = rounddown(cpu->pstate.turbo_pstate * scaling,
586591
perf_ctl_scaling);
587592
cpu->pstate.max_freq = rounddown(cpu->pstate.max_pstate * scaling,
@@ -1044,9 +1049,9 @@ static void hybrid_set_cpu_capacity(struct cpudata *cpu)
10441049

10451050
topology_set_cpu_scale(cpu->cpu, arch_scale_cpu_capacity(cpu->cpu));
10461051

1047-
pr_debug("CPU%d: perf = %u, max. perf = %u, base perf = %d\n", cpu->cpu,
1048-
cpu->capacity_perf, hybrid_max_perf_cpu->capacity_perf,
1049-
cpu->pstate.max_pstate_physical);
1052+
pr_debug("CPU%d: capacity perf = %u, base perf = %u, sys max perf = %u\n",
1053+
cpu->cpu, cpu->capacity_perf, cpu->pstate.max_pstate_physical,
1054+
hybrid_max_perf_cpu->capacity_perf);
10501055
}
10511056

10521057
static void hybrid_clear_cpu_capacity(unsigned int cpunum)
@@ -2344,22 +2349,18 @@ static void intel_pstate_set_min_pstate(struct cpudata *cpu)
23442349

23452350
static void intel_pstate_get_cpu_pstates(struct cpudata *cpu)
23462351
{
2347-
int perf_ctl_max_phys = pstate_funcs.get_max_physical(cpu->cpu);
23482352
int perf_ctl_scaling = pstate_funcs.get_scaling();
23492353

2354+
cpu->pstate.max_pstate_physical = pstate_funcs.get_max_physical(cpu->cpu);
23502355
cpu->pstate.min_pstate = pstate_funcs.get_min(cpu->cpu);
2351-
cpu->pstate.max_pstate_physical = perf_ctl_max_phys;
23522356
cpu->pstate.perf_ctl_scaling = perf_ctl_scaling;
23532357

23542358
if (hwp_active && !hwp_mode_bdw) {
23552359
__intel_pstate_get_hwp_cap(cpu);
23562360

23572361
if (pstate_funcs.get_cpu_scaling) {
23582362
cpu->pstate.scaling = pstate_funcs.get_cpu_scaling(cpu->cpu);
2359-
if (cpu->pstate.scaling != perf_ctl_scaling) {
2360-
intel_pstate_hybrid_hwp_adjust(cpu);
2361-
hwp_is_hybrid = true;
2362-
}
2363+
intel_pstate_hybrid_hwp_adjust(cpu);
23632364
} else {
23642365
cpu->pstate.scaling = perf_ctl_scaling;
23652366
}

0 commit comments

Comments
 (0)