* [PATCH] Revert "cpufreq: intel_pstate: Fix ->set_policy() interface for no_turbo" @ 2018-08-04 15:29 Gabriele Mazzotta 2018-08-04 17:31 ` Gabriele Mazzotta 0 siblings, 1 reply; 9+ messages in thread From: Gabriele Mazzotta @ 2018-08-04 15:29 UTC (permalink / raw) To: srinivas.pandruvada, rjw Cc: lenb, viresh.kumar, linux-pm, linux-kernel, Gabriele Mazzotta This change does not take into account that some BIOSes change MSR_IA32_MISC_ENABLE_TURBO_DISABLE depending on the power source. If the turbo is disabled when the system boots, policy.max_freq is set to pstate.max_pstate. However, if the BIOS later enables the turbo, the CPU will never be able to run at pstate.turbo_pstate. Since now intel_pstate_set_policy() does its calculations using pstate.max_freq and pstate.turbo_freq, we can always calculate cpuinfo.max_freq using pstate.turbo_pstate, thus allowing system with varying MSR_IA32_MISC_ENABLE_TURBO_DISABLE to run at full speed when the turbo is enabled. This reverts commit 983e600e88835f0321d1a0ea06f52d48b7b5a544. Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> --- drivers/cpufreq/intel_pstate.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 3c3971256130..4043aae2d611 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -2068,9 +2068,8 @@ static int __intel_pstate_cpu_init(struct cpufreq_policy *policy) /* cpuinfo and default policy values */ policy->cpuinfo.min_freq = cpu->pstate.min_pstate * cpu->pstate.scaling; update_turbo_state(); - policy->cpuinfo.max_freq = global.turbo_disabled ? - cpu->pstate.max_pstate : cpu->pstate.turbo_pstate; - policy->cpuinfo.max_freq *= cpu->pstate.scaling; + policy->cpuinfo.max_freq = + cpu->pstate.turbo_pstate * cpu->pstate.scaling; intel_pstate_init_acpi_perf_limits(policy); -- 2.18.0 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] Revert "cpufreq: intel_pstate: Fix ->set_policy() interface for no_turbo" 2018-08-04 15:29 [PATCH] Revert "cpufreq: intel_pstate: Fix ->set_policy() interface for no_turbo" Gabriele Mazzotta @ 2018-08-04 17:31 ` Gabriele Mazzotta 2018-08-06 8:30 ` Rafael J. Wysocki 0 siblings, 1 reply; 9+ messages in thread From: Gabriele Mazzotta @ 2018-08-04 17:31 UTC (permalink / raw) To: srinivas.pandruvada, rjw; +Cc: lenb, viresh.kumar, linux-pm, linux-kernel On 04/08/2018 17:29, Gabriele Mazzotta wrote: > This change does not take into account that some BIOSes change > MSR_IA32_MISC_ENABLE_TURBO_DISABLE depending on the power source. > If the turbo is disabled when the system boots, policy.max_freq > is set to pstate.max_pstate. However, if the BIOS later enables > the turbo, the CPU will never be able to run at pstate.turbo_pstate. > > Since now intel_pstate_set_policy() does its calculations using > pstate.max_freq and pstate.turbo_freq, we can always calculate > cpuinfo.max_freq using pstate.turbo_pstate, thus allowing system > with varying MSR_IA32_MISC_ENABLE_TURBO_DISABLE to run at full > speed when the turbo is enabled. > > This reverts commit 983e600e88835f0321d1a0ea06f52d48b7b5a544. > > Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> > --- > drivers/cpufreq/intel_pstate.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c > index 3c3971256130..4043aae2d611 100644 > --- a/drivers/cpufreq/intel_pstate.c > +++ b/drivers/cpufreq/intel_pstate.c > @@ -2068,9 +2068,8 @@ static int __intel_pstate_cpu_init(struct cpufreq_policy *policy) > /* cpuinfo and default policy values */ > policy->cpuinfo.min_freq = cpu->pstate.min_pstate * cpu->pstate.scaling; > update_turbo_state(); Commit 983e600e8883 added this update_turbo_state() call, but it is needed by intel_pstate_init_acpi_perf_limits() here below. I should have mentioned it in the commit message. However, I've just realized that a similar problem to that I'm trying to fix can occur on those systems where core_frequency is adjusted depending on the availability of the turbo. The call to update_turbo_state() could also be moved in intel_pstate_init_acpi_perf_limits(), right before the check on global.turbo_disabled. > - policy->cpuinfo.max_freq = global.turbo_disabled ? > - cpu->pstate.max_pstate : cpu->pstate.turbo_pstate; > - policy->cpuinfo.max_freq *= cpu->pstate.scaling; > + policy->cpuinfo.max_freq = > + cpu->pstate.turbo_pstate * cpu->pstate.scaling; > > intel_pstate_init_acpi_perf_limits(policy); > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Revert "cpufreq: intel_pstate: Fix ->set_policy() interface for no_turbo" 2018-08-04 17:31 ` Gabriele Mazzotta @ 2018-08-06 8:30 ` Rafael J. Wysocki 2018-08-06 16:49 ` Srinivas Pandruvada 0 siblings, 1 reply; 9+ messages in thread From: Rafael J. Wysocki @ 2018-08-06 8:30 UTC (permalink / raw) To: Gabriele Mazzotta Cc: Srinivas Pandruvada, Rafael J. Wysocki, Len Brown, Viresh Kumar, Linux PM, Linux Kernel Mailing List On Sat, Aug 4, 2018 at 7:31 PM, Gabriele Mazzotta <gabriele.mzt@gmail.com> wrote: > On 04/08/2018 17:29, Gabriele Mazzotta wrote: >> This change does not take into account that some BIOSes change >> MSR_IA32_MISC_ENABLE_TURBO_DISABLE depending on the power source. >> If the turbo is disabled when the system boots, policy.max_freq >> is set to pstate.max_pstate. However, if the BIOS later enables >> the turbo, the CPU will never be able to run at pstate.turbo_pstate. >> >> Since now intel_pstate_set_policy() does its calculations using >> pstate.max_freq and pstate.turbo_freq, we can always calculate >> cpuinfo.max_freq using pstate.turbo_pstate, thus allowing system >> with varying MSR_IA32_MISC_ENABLE_TURBO_DISABLE to run at full >> speed when the turbo is enabled. Well, the problem with this approach is that always using pstate.turbo_pstate as the max causes the governor to overestimate the target frequency when the turbo range is not available (the target depends on the width of the entire available P-state range including turbo, so if the turbo range is not available, the number take into that computation is too large). Are we expected to get notified when the BIOS updates MSR_IA32_MISC_ENABLE_TURBO_DISABLE? ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Revert "cpufreq: intel_pstate: Fix ->set_policy() interface for no_turbo" 2018-08-06 8:30 ` Rafael J. Wysocki @ 2018-08-06 16:49 ` Srinivas Pandruvada 2018-08-06 21:50 ` Gabriele Mazzotta 0 siblings, 1 reply; 9+ messages in thread From: Srinivas Pandruvada @ 2018-08-06 16:49 UTC (permalink / raw) To: Rafael J. Wysocki, Gabriele Mazzotta Cc: Rafael J. Wysocki, Len Brown, Viresh Kumar, Linux PM, Linux Kernel Mailing List On Mon, 2018-08-06 at 10:30 +0200, Rafael J. Wysocki wrote: > On Sat, Aug 4, 2018 at 7:31 PM, Gabriele Mazzotta > <gabriele.mzt@gmail.com> wrote: > > On 04/08/2018 17:29, Gabriele Mazzotta wrote: > > > This change does not take into account that some BIOSes change > > > MSR_IA32_MISC_ENABLE_TURBO_DISABLE depending on the power source. > > > If the turbo is disabled when the system boots, policy.max_freq > > > is set to pstate.max_pstate. However, if the BIOS later enables > > > the turbo, the CPU will never be able to run at > > > pstate.turbo_pstate. > > > > > > Since now intel_pstate_set_policy() does its calculations using > > > pstate.max_freq and pstate.turbo_freq, we can always calculate > > > cpuinfo.max_freq using pstate.turbo_pstate, thus allowing system > > > with varying MSR_IA32_MISC_ENABLE_TURBO_DISABLE to run at full > > > speed when the turbo is enabled. > > Well, the problem with this approach is that always using > pstate.turbo_pstate as the max causes the governor to overestimate > the > target frequency when the turbo range is not available (the target > depends on the width of the entire available P-state range including > turbo, so if the turbo range is not available, the number take into > that computation is too large). > > Are we expected to get notified when the BIOS updates > MSR_IA32_MISC_ENABLE_TURBO_DISABLE? Let's try this: - boot with kernel command line intel_pstate=support_acpi_ppc dyndbg="file processor_perflib.c +p" dyndbg="file intel_pstate.c +p" and send dmesg after you change power sources. - Also try with intel_pstate=disable dyndbg="file processor_perflib.c +p" and send dmesg. Thanks, Srinivas ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Revert "cpufreq: intel_pstate: Fix ->set_policy() interface for no_turbo" 2018-08-06 16:49 ` Srinivas Pandruvada @ 2018-08-06 21:50 ` Gabriele Mazzotta 2018-08-06 22:11 ` Srinivas Pandruvada 0 siblings, 1 reply; 9+ messages in thread From: Gabriele Mazzotta @ 2018-08-06 21:50 UTC (permalink / raw) To: Srinivas Pandruvada, Rafael J. Wysocki Cc: Rafael J. Wysocki, Len Brown, Viresh Kumar, Linux PM, Linux Kernel Mailing List On 06/08/2018 18:49, Srinivas Pandruvada wrote: > On Mon, 2018-08-06 at 10:30 +0200, Rafael J. Wysocki wrote: >> On Sat, Aug 4, 2018 at 7:31 PM, Gabriele Mazzotta >> <gabriele.mzt@gmail.com> wrote: >>> On 04/08/2018 17:29, Gabriele Mazzotta wrote: >>>> This change does not take into account that some BIOSes change >>>> MSR_IA32_MISC_ENABLE_TURBO_DISABLE depending on the power source. >>>> If the turbo is disabled when the system boots, policy.max_freq >>>> is set to pstate.max_pstate. However, if the BIOS later enables >>>> the turbo, the CPU will never be able to run at >>>> pstate.turbo_pstate. >>>> >>>> Since now intel_pstate_set_policy() does its calculations using >>>> pstate.max_freq and pstate.turbo_freq, we can always calculate >>>> cpuinfo.max_freq using pstate.turbo_pstate, thus allowing system >>>> with varying MSR_IA32_MISC_ENABLE_TURBO_DISABLE to run at full >>>> speed when the turbo is enabled. >> >> Well, the problem with this approach is that always using >> pstate.turbo_pstate as the max causes the governor to overestimate >> the >> target frequency when the turbo range is not available (the target >> depends on the width of the entire available P-state range including >> turbo, so if the turbo range is not available, the number take into >> that computation is too large). >> >> Are we expected to get notified when the BIOS updates >> MSR_IA32_MISC_ENABLE_TURBO_DISABLE? > > Let's try this: > - boot with kernel command line > > intel_pstate=support_acpi_ppc dyndbg="file processor_perflib.c +p" > dyndbg="file intel_pstate.c +p" Plugged -> Unplugged: [ 40.046116] CPU 0: _PPC is 6 - frequency limited [ 40.046128] intel_pstate: policy->max > max non turbo frequency [ 40.046131] intel_pstate: set_policy cpuinfo.max 3000000 policy->max 3000000 [ 40.046134] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 max_policy_perf:30 [ 40.046137] intel_pstate: cpu:0 global_min:8 global_max:30 [ 40.046140] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 [ 40.162173] CPU 0: _PPC is 6 - frequency limited [ 40.162186] intel_pstate: policy->max > max non turbo frequency [ 40.162190] intel_pstate: set_policy cpuinfo.max 3000000 policy->max 3000000 [ 40.162194] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 max_policy_perf:30 [ 40.162197] intel_pstate: cpu:0 global_min:8 global_max:30 [ 40.162200] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 [ 40.162215] CPU 0: _PPC is 6 - frequency limited [ 40.162220] intel_pstate: policy->max > max non turbo frequency [ 40.162223] intel_pstate: set_policy cpuinfo.max 3000000 policy->max 3000000 [ 40.162226] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 max_policy_perf:30 [ 40.162228] intel_pstate: cpu:0 global_min:8 global_max:30 [ 40.162230] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 [ 40.162237] CPU 0: _PPC is 6 - frequency limited [ 40.162241] intel_pstate: policy->max > max non turbo frequency [ 40.162243] intel_pstate: set_policy cpuinfo.max 3000000 policy->max 3000000 [ 40.162245] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 max_policy_perf:30 [ 40.162247] intel_pstate: cpu:0 global_min:8 global_max:30 [ 40.162249] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 [ 40.162257] CPU 0: _PPC is 6 - frequency limited [ 40.162261] intel_pstate: policy->max > max non turbo frequency [ 40.162263] intel_pstate: set_policy cpuinfo.max 3000000 policy->max 3000000 [ 40.162265] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 max_policy_perf:30 [ 40.162267] intel_pstate: cpu:0 global_min:8 global_max:30 [ 40.162269] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 Unplugged -> Plugged: [ 52.648535] CPU 0: _PPC is 6 - frequency limited [ 52.648553] intel_pstate: set_policy cpuinfo.max 3000000 policy->max 1700000 [ 52.648558] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 max_policy_perf:17 [ 52.648562] intel_pstate: cpu:0 global_min:8 global_max:30 [ 52.648566] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 [ 52.648583] CPU 0: _PPC is 6 - frequency limited [ 52.648590] intel_pstate: set_policy cpuinfo.max 3000000 policy->max 1700000 [ 52.648595] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 max_policy_perf:17 [ 52.648598] intel_pstate: cpu:0 global_min:8 global_max:30 [ 52.648602] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 [ 52.656093] CPU 0: _PPC is 6 - frequency limited [ 52.656111] intel_pstate: set_policy cpuinfo.max 3000000 policy->max 1700000 [ 52.656116] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 max_policy_perf:17 [ 52.656120] intel_pstate: cpu:0 global_min:8 global_max:30 [ 52.656123] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 [ 52.775577] CPU 0: _PPC is 6 - frequency limited [ 52.775594] intel_pstate: set_policy cpuinfo.max 3000000 policy->max 1700000 [ 52.775598] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 max_policy_perf:17 [ 52.775601] intel_pstate: cpu:0 global_min:8 global_max:30 [ 52.775604] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 [ 53.028620] CPU 0: _PPC is 6 - frequency limited [ 53.028637] intel_pstate: set_policy cpuinfo.max 3000000 policy->max 1700000 [ 53.028643] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 max_policy_perf:17 [ 53.028647] intel_pstate: cpu:0 global_min:8 global_max:30 [ 53.028651] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 > and send dmesg after you change power sources. > > - Also try with > intel_pstate=disable dyndbg="file processor_perflib.c +p" Nothing gets printed with this one. Thanks, Gabriele > and send dmesg. > > Thanks, > Srinivas > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Revert "cpufreq: intel_pstate: Fix ->set_policy() interface for no_turbo" 2018-08-06 21:50 ` Gabriele Mazzotta @ 2018-08-06 22:11 ` Srinivas Pandruvada 2018-08-07 20:12 ` Gabriele Mazzotta 0 siblings, 1 reply; 9+ messages in thread From: Srinivas Pandruvada @ 2018-08-06 22:11 UTC (permalink / raw) To: Gabriele Mazzotta, Rafael J. Wysocki Cc: Rafael J. Wysocki, Len Brown, Viresh Kumar, Linux PM, Linux Kernel Mailing List On Mon, 2018-08-06 at 23:50 +0200, Gabriele Mazzotta wrote: > On 06/08/2018 18:49, Srinivas Pandruvada wrote: > > On Mon, 2018-08-06 at 10:30 +0200, Rafael J. Wysocki wrote: > > > On Sat, Aug 4, 2018 at 7:31 PM, Gabriele Mazzotta > > > <gabriele.mzt@gmail.com> wrote: > > > > On 04/08/2018 17:29, Gabriele Mazzotta wrote: > > > > > This change does not take into account that some BIOSes > > > > > change > > > > > MSR_IA32_MISC_ENABLE_TURBO_DISABLE depending on the power > > > > > source. > > > > > If the turbo is disabled when the system boots, > > > > > policy.max_freq > > > > > is set to pstate.max_pstate. However, if the BIOS later > > > > > enables > > > > > the turbo, the CPU will never be able to run at > > > > > pstate.turbo_pstate. > > > > > > > > > > Since now intel_pstate_set_policy() does its calculations > > > > > using > > > > > pstate.max_freq and pstate.turbo_freq, we can always > > > > > calculate > > > > > cpuinfo.max_freq using pstate.turbo_pstate, thus allowing > > > > > system > > > > > with varying MSR_IA32_MISC_ENABLE_TURBO_DISABLE to run at > > > > > full > > > > > speed when the turbo is enabled. > > > > > > Well, the problem with this approach is that always using > > > pstate.turbo_pstate as the max causes the governor to > > > overestimate > > > the > > > target frequency when the turbo range is not available (the > > > target > > > depends on the width of the entire available P-state range > > > including > > > turbo, so if the turbo range is not available, the number take > > > into > > > that computation is too large). > > > > > > Are we expected to get notified when the BIOS updates > > > MSR_IA32_MISC_ENABLE_TURBO_DISABLE? > > > > Let's try this: > > - boot with kernel command line > > > > intel_pstate=support_acpi_ppc dyndbg="file processor_perflib.c +p" > > dyndbg="file intel_pstate.c +p" > Interesting output. Can you run ? # turbostat --debug in both plugged and unplugged state. Also output of acpidump? > Plugged -> Unplugged: > > [ 40.046116] CPU 0: _PPC is 6 - frequency limited > [ 40.046128] intel_pstate: policy->max > max non turbo frequency > [ 40.046131] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 3000000 > [ 40.046134] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 > max_policy_perf:30 > [ 40.046137] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 40.046140] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 > [ 40.162173] CPU 0: _PPC is 6 - frequency limited > [ 40.162186] intel_pstate: policy->max > max non turbo frequency > [ 40.162190] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 3000000 > [ 40.162194] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 > max_policy_perf:30 > [ 40.162197] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 40.162200] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 > [ 40.162215] CPU 0: _PPC is 6 - frequency limited > [ 40.162220] intel_pstate: policy->max > max non turbo frequency > [ 40.162223] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 3000000 > [ 40.162226] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 > max_policy_perf:30 > [ 40.162228] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 40.162230] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 > [ 40.162237] CPU 0: _PPC is 6 - frequency limited > [ 40.162241] intel_pstate: policy->max > max non turbo frequency > [ 40.162243] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 3000000 > [ 40.162245] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 > max_policy_perf:30 > [ 40.162247] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 40.162249] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 > [ 40.162257] CPU 0: _PPC is 6 - frequency limited > [ 40.162261] intel_pstate: policy->max > max non turbo frequency > [ 40.162263] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 3000000 > [ 40.162265] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 > max_policy_perf:30 > [ 40.162267] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 40.162269] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 > > Unplugged -> Plugged: > > [ 52.648535] CPU 0: _PPC is 6 - frequency limited > [ 52.648553] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 1700000 > [ 52.648558] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 > max_policy_perf:17 > [ 52.648562] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 52.648566] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 > [ 52.648583] CPU 0: _PPC is 6 - frequency limited > [ 52.648590] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 1700000 > [ 52.648595] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 > max_policy_perf:17 > [ 52.648598] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 52.648602] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 > [ 52.656093] CPU 0: _PPC is 6 - frequency limited > [ 52.656111] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 1700000 > [ 52.656116] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 > max_policy_perf:17 > [ 52.656120] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 52.656123] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 > [ 52.775577] CPU 0: _PPC is 6 - frequency limited > [ 52.775594] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 1700000 > [ 52.775598] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 > max_policy_perf:17 > [ 52.775601] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 52.775604] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 > [ 53.028620] CPU 0: _PPC is 6 - frequency limited > [ 53.028637] intel_pstate: set_policy cpuinfo.max 3000000 policy- > >max 1700000 > [ 53.028643] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 > max_policy_perf:17 > [ 53.028647] intel_pstate: cpu:0 global_min:8 global_max:30 > [ 53.028651] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 > > > and send dmesg after you change power sources. > > > > - Also try with > > intel_pstate=disable dyndbg="file processor_perflib.c +p" > > Nothing gets printed with this one. > > Thanks, > Gabriele > > > and send dmesg. > > > > Thanks, > > Srinivas > > > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Revert "cpufreq: intel_pstate: Fix ->set_policy() interface for no_turbo" 2018-08-06 22:11 ` Srinivas Pandruvada @ 2018-08-07 20:12 ` Gabriele Mazzotta 2018-08-07 21:22 ` Srinivas Pandruvada 0 siblings, 1 reply; 9+ messages in thread From: Gabriele Mazzotta @ 2018-08-07 20:12 UTC (permalink / raw) To: Srinivas Pandruvada, Rafael J. Wysocki Cc: Rafael J. Wysocki, Len Brown, Viresh Kumar, Linux PM, Linux Kernel Mailing List On 07/08/2018 00:11, Srinivas Pandruvada wrote: > On Mon, 2018-08-06 at 23:50 +0200, Gabriele Mazzotta wrote: >> On 06/08/2018 18:49, Srinivas Pandruvada wrote: >>> On Mon, 2018-08-06 at 10:30 +0200, Rafael J. Wysocki wrote: >>>> On Sat, Aug 4, 2018 at 7:31 PM, Gabriele Mazzotta >>>> <gabriele.mzt@gmail.com> wrote: >>>>> On 04/08/2018 17:29, Gabriele Mazzotta wrote: >>>>>> This change does not take into account that some BIOSes >>>>>> change >>>>>> MSR_IA32_MISC_ENABLE_TURBO_DISABLE depending on the power >>>>>> source. >>>>>> If the turbo is disabled when the system boots, >>>>>> policy.max_freq >>>>>> is set to pstate.max_pstate. However, if the BIOS later >>>>>> enables >>>>>> the turbo, the CPU will never be able to run at >>>>>> pstate.turbo_pstate. >>>>>> >>>>>> Since now intel_pstate_set_policy() does its calculations >>>>>> using >>>>>> pstate.max_freq and pstate.turbo_freq, we can always >>>>>> calculate >>>>>> cpuinfo.max_freq using pstate.turbo_pstate, thus allowing >>>>>> system >>>>>> with varying MSR_IA32_MISC_ENABLE_TURBO_DISABLE to run at >>>>>> full >>>>>> speed when the turbo is enabled. >>>> >>>> Well, the problem with this approach is that always using >>>> pstate.turbo_pstate as the max causes the governor to >>>> overestimate >>>> the >>>> target frequency when the turbo range is not available (the >>>> target >>>> depends on the width of the entire available P-state range >>>> including >>>> turbo, so if the turbo range is not available, the number take >>>> into >>>> that computation is too large). >>>> >>>> Are we expected to get notified when the BIOS updates >>>> MSR_IA32_MISC_ENABLE_TURBO_DISABLE? >>> >>> Let's try this: >>> - boot with kernel command line >>> >>> intel_pstate=support_acpi_ppc dyndbg="file processor_perflib.c +p" >>> dyndbg="file intel_pstate.c +p" >> > Interesting output. > Can you run ? > # turbostat --debug > in both plugged and unplugged state. This is the output of turbostat while plugged in, with intel_pstate=support_acpi_ppc in the cmdline: turbostat version 18.06.20 - Len Brown <lenb@kernel.org> CPUID(0): GenuineIntel 13 CPUID levels; family:model:stepping 0x6:45:1 (6:69:1) CPUID(1): SSE3 MONITOR - EIST TM2 TSC MSR ACPI-TM HT TM CPUID(6): APERF, TURBO, DTS, PTM, No-HWP, No-HWPnotify, No-HWPwindow, No-HWPepp, No-HWPpkg, EPB cpu0: MSR_IA32_MISC_ENABLE: 0x00850089 (TCC EIST MWAIT PREFETCH TURBO) CPUID(7): No-SGX cpu0: MSR_MISC_PWR_MGMT: 0x00400000 (ENable-EIST_Coordination DISable-EPB DISable-OOB) RAPL: 17476 sec. Joule Counter Range, at 15 Watts cpu0: MSR_PLATFORM_INFO: 0x8083df3011800 8 * 100.0 = 800.0 MHz max efficiency frequency 24 * 100.0 = 2400.0 MHz base frequency cpu0: MSR_IA32_POWER_CTL: 0x0004005d (C1E auto-promotion: DISabled) cpu0: MSR_TURBO_RATIO_LIMIT: 0x1b1b1b1e 27 * 100.0 = 2700.0 MHz max turbo 4 active cores 27 * 100.0 = 2700.0 MHz max turbo 3 active cores 27 * 100.0 = 2700.0 MHz max turbo 2 active cores 30 * 100.0 = 3000.0 MHz max turbo 1 active cores cpu0: MSR_CONFIG_TDP_NOMINAL: 0x00000012 (base_ratio=18) cpu0: MSR_CONFIG_TDP_LEVEL_1: 0x0008005c (PKG_MIN_PWR_LVL1=0 PKG_MAX_PWR_LVL1=0 LVL1_RATIO=8 PKG_TDP_LVL1=92) cpu0: MSR_CONFIG_TDP_LEVEL_2: 0x001800c8 (PKG_MIN_PWR_LVL2=0 PKG_MAX_PWR_LVL2=0 LVL2_RATIO=24 PKG_TDP_LVL2=200) cpu0: MSR_CONFIG_TDP_CONTROL: 0x00000000 ( lock=0) cpu0: MSR_TURBO_ACTIVATION_RATIO: 0x00000011 (MAX_NON_TURBO_RATIO=17 lock=0) cpu0: MSR_PKG_CST_CONFIG_CONTROL: 0x1e008407 (UNdemote-C3, UNdemote-C1, demote-C3, demote-C1, locked, pkg-cstate-limit=7 (pc9)) cpu0: POLL: CPUIDLE CORE POLL IDLE cpu0: C1: MWAIT 0x00 cpu0: C1E: MWAIT 0x01 cpu0: C3: MWAIT 0x10 cpu0: C6: MWAIT 0x20 cpu0: C7s: MWAIT 0x32 cpu0: C8: MWAIT 0x40 cpu0: C9: MWAIT 0x50 cpu0: C10: MWAIT 0x60 cpu0: cpufreq driver: intel_pstate cpu0: cpufreq governor: powersave cpufreq intel_pstate no_turbo: 0 cpu0: MSR_MISC_FEATURE_CONTROL: 0x00000000 (L2-Prefetch L2-Prefetch-pair L1-Prefetch L1-IP-Prefetch) cpu0: MSR_IA32_ENERGY_PERF_BIAS: 0x00000006 (balanced) cpu0: MSR_CORE_PERF_LIMIT_REASONS, 0x1d210020 (Active: Auto-HWP, ) (Logged: MultiCoreTurbo, PkgPwrL2, PkgPwrL1, Amps, Auto-HWP, PROCHOT, ) cpu0: MSR_GFX_PERF_LIMIT_REASONS, 0x1c010000 (Active: ) (Logged: PROCHOT, PkgPwrL1, PkgPwrL2, ) cpu0: MSR_RING_PERF_LIMIT_REASONS, 0x0d010000 (Active: ) (Logged: PROCHOT, Amps, PkgPwrL1, PkgPwrL2, ) cpu0: MSR_RAPL_POWER_UNIT: 0x000a0e03 (0.125000 Watts, 0.000061 Joules, 0.000977 sec.) cpu0: MSR_PKG_POWER_INFO: 0x00000078 (15 W TDP, RAPL 0 - 0 W, 0.000000 sec.) cpu0: MSR_PKG_POWER_LIMIT: 0x420078001480c8 (UNlocked) cpu0: PKG Limit #1: ENabled (25.000000 Watts, 1.000000 sec, clamp DISabled) cpu0: PKG Limit #2: DISabled (15.000000 Watts, 0.002441* sec, clamp DISabled) cpu0: MSR_PP0_POLICY: 0 cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked) cpu0: Cores Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled) cpu0: MSR_PP1_POLICY: 0 cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked) cpu0: GFX Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled) cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x00640000 (100 C) cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x882d0808 (55 C) cpu0: MSR_IA32_PACKAGE_THERM_INTERRUPT: 0x00000003 (100 C, 100 C) cpu0: MSR_IA32_THERM_STATUS: 0x882d0808 (55 C +/- 1) cpu0: MSR_IA32_THERM_INTERRUPT: 0x00000013 (100 C, 100 C) cpu2: MSR_IA32_THERM_STATUS: 0x88300808 (52 C +/- 1) cpu2: MSR_IA32_THERM_INTERRUPT: 0x00000013 (100 C, 100 C) cpu0: MSR_PKGC3_IRTL: 0x00008842 (valid, 67584 ns) cpu0: MSR_PKGC6_IRTL: 0x00008873 (valid, 117760 ns) cpu0: MSR_PKGC7_IRTL: 0x00008891 (valid, 148480 ns) cpu0: MSR_PKGC8_IRTL: 0x000088e4 (valid, 233472 ns) cpu0: MSR_PKGC9_IRTL: 0x00008945 (valid, 332800 ns) cpu0: MSR_PKGC10_IRTL: 0x00009003 (valid, 3 ns) And this is what I get after I unplug the laptop: turbostat version 18.06.20 - Len Brown <lenb@kernel.org> CPUID(0): GenuineIntel 13 CPUID levels; family:model:stepping 0x6:45:1 (6:69:1) CPUID(1): SSE3 MONITOR - EIST TM2 TSC MSR ACPI-TM HT TM CPUID(6): APERF, No-TURBO, DTS, PTM, No-HWP, No-HWPnotify, No-HWPwindow, No-HWPepp, No-HWPpkg, EPB cpu3: MSR_IA32_MISC_ENABLE: 0x4000850089 (TCC EIST MWAIT PREFETCH No-TURBO) CPUID(7): No-SGX cpu3: MSR_MISC_PWR_MGMT: 0x00400000 (ENable-EIST_Coordination DISable-EPB DISable-OOB) RAPL: 17476 sec. Joule Counter Range, at 15 Watts cpu3: MSR_PLATFORM_INFO: 0x8083df3011800 8 * 100.0 = 800.0 MHz max efficiency frequency 24 * 100.0 = 2400.0 MHz base frequency cpu3: MSR_IA32_POWER_CTL: 0x0004005d (C1E auto-promotion: DISabled) cpu3: MSR_TURBO_RATIO_LIMIT: 0x1b1b1b1e 27 * 100.0 = 2700.0 MHz max turbo 4 active cores 27 * 100.0 = 2700.0 MHz max turbo 3 active cores 27 * 100.0 = 2700.0 MHz max turbo 2 active cores 30 * 100.0 = 3000.0 MHz max turbo 1 active cores cpu3: MSR_CONFIG_TDP_NOMINAL: 0x00000012 (base_ratio=18) cpu3: MSR_CONFIG_TDP_LEVEL_1: 0x0008005c (PKG_MIN_PWR_LVL1=0 PKG_MAX_PWR_LVL1=0 LVL1_RATIO=8 PKG_TDP_LVL1=92) cpu3: MSR_CONFIG_TDP_LEVEL_2: 0x001800c8 (PKG_MIN_PWR_LVL2=0 PKG_MAX_PWR_LVL2=0 LVL2_RATIO=24 PKG_TDP_LVL2=200) cpu3: MSR_CONFIG_TDP_CONTROL: 0x00000000 ( lock=0) cpu3: MSR_TURBO_ACTIVATION_RATIO: 0x00000011 (MAX_NON_TURBO_RATIO=17 lock=0) cpu3: MSR_PKG_CST_CONFIG_CONTROL: 0x1e008407 (UNdemote-C3, UNdemote-C1, demote-C3, demote-C1, locked, pkg-cstate-limit=7 (pc9)) cpu3: POLL: CPUIDLE CORE POLL IDLE cpu3: C1: MWAIT 0x00 cpu3: C1E: MWAIT 0x01 cpu3: C3: MWAIT 0x10 cpu3: C6: MWAIT 0x20 cpu3: C7s: MWAIT 0x32 cpu3: C8: MWAIT 0x40 cpu3: C9: MWAIT 0x50 cpu3: C10: MWAIT 0x60 cpu3: cpufreq driver: intel_pstate cpu3: cpufreq governor: powersave cpufreq intel_pstate no_turbo: 1 cpu3: MSR_MISC_FEATURE_CONTROL: 0x00000000 (L2-Prefetch L2-Prefetch-pair L1-Prefetch L1-IP-Prefetch) cpu0: MSR_IA32_ENERGY_PERF_BIAS: 0x00000006 (balanced) cpu0: MSR_CORE_PERF_LIMIT_REASONS, 0x1d210000 (Active: ) (Logged: MultiCoreTurbo, PkgPwrL2, PkgPwrL1, Amps, Auto-HWP, PROCHOT, ) cpu0: MSR_GFX_PERF_LIMIT_REASONS, 0x1c010000 (Active: ) (Logged: PROCHOT, PkgPwrL1, PkgPwrL2, ) cpu0: MSR_RING_PERF_LIMIT_REASONS, 0x0d010000 (Active: ) (Logged: PROCHOT, Amps, PkgPwrL1, PkgPwrL2, ) cpu0: MSR_RAPL_POWER_UNIT: 0x000a0e03 (0.125000 Watts, 0.000061 Joules, 0.000977 sec.) cpu0: MSR_PKG_POWER_INFO: 0x00000078 (15 W TDP, RAPL 0 - 0 W, 0.000000 sec.) cpu0: MSR_PKG_POWER_LIMIT: 0x420078001480c8 (UNlocked) cpu0: PKG Limit #1: ENabled (25.000000 Watts, 1.000000 sec, clamp DISabled) cpu0: PKG Limit #2: DISabled (15.000000 Watts, 0.002441* sec, clamp DISabled) cpu0: MSR_PP0_POLICY: 0 cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked) cpu0: Cores Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled) cpu0: MSR_PP1_POLICY: 0 cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked) cpu0: GFX Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled) cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x00640000 (100 C) cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x882f0808 (53 C) cpu0: MSR_IA32_PACKAGE_THERM_INTERRUPT: 0x00000003 (100 C, 100 C) cpu0: MSR_IA32_THERM_STATUS: 0x882f0808 (53 C +/- 1) cpu0: MSR_IA32_THERM_INTERRUPT: 0x00000013 (100 C, 100 C) cpu2: MSR_IA32_THERM_STATUS: 0x88300808 (52 C +/- 1) cpu2: MSR_IA32_THERM_INTERRUPT: 0x00000013 (100 C, 100 C) cpu3: MSR_PKGC3_IRTL: 0x00008842 (valid, 67584 ns) cpu3: MSR_PKGC6_IRTL: 0x00008873 (valid, 117760 ns) cpu3: MSR_PKGC7_IRTL: 0x00008891 (valid, 148480 ns) cpu3: MSR_PKGC8_IRTL: 0x000088e4 (valid, 233472 ns) cpu3: MSR_PKGC9_IRTL: 0x00008945 (valid, 332800 ns) cpu3: MSR_PKGC10_IRTL: 0x00009003 (valid, 3 ns) MSR_CORE_PERF_LIMIT_REASONS seems to have a different value when plugged in depending on how the laptop booted. I don't know if this is relevant, but this is what I noticed. Right after a reboot while plugged in, I get: cpu0: MSR_CORE_PERF_LIMIT_REASONS, 0x1d201000 (Active: MultiCoreTurbo, ) (Logged: MultiCoreTurbo, PkgPwrL2, PkgPwrL1, Amps, Auto-HWP, ) If unplug and replug, I get: cpu0: MSR_CORE_PERF_LIMIT_REASONS, 0x1d210020 (Active: Auto-HWP, ) (Logged: MultiCoreTurbo, PkgPwrL2, PkgPwrL1, Amps, Auto-HWP, PROCHOT, ) If the laptop booted while unplgged, I constantly get: cpu0: MSR_CORE_PERF_LIMIT_REASONS, 0x14000000 (Active: ) (Logged: MultiCoreTurbo, PkgPwrL1, ) > Also output of acpidump? You can find it here: https://bugzilla.kernel.org/attachment.cgi?id=178381 > >> Plugged -> Unplugged: >> >> [ 40.046116] CPU 0: _PPC is 6 - frequency limited >> [ 40.046128] intel_pstate: policy->max > max non turbo frequency >> [ 40.046131] intel_pstate: set_policy cpuinfo.max 3000000 policy- >>> max 3000000 >> [ 40.046134] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 >> max_policy_perf:30 >> [ 40.046137] intel_pstate: cpu:0 global_min:8 global_max:30 >> [ 40.046140] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 >> [ 40.162173] CPU 0: _PPC is 6 - frequency limited >> [ 40.162186] intel_pstate: policy->max > max non turbo frequency >> [ 40.162190] intel_pstate: set_policy cpuinfo.max 3000000 policy- >>> max 3000000 >> [ 40.162194] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 >> max_policy_perf:30 >> [ 40.162197] intel_pstate: cpu:0 global_min:8 global_max:30 >> [ 40.162200] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 >> [ 40.162215] CPU 0: _PPC is 6 - frequency limited >> [ 40.162220] intel_pstate: policy->max > max non turbo frequency >> [ 40.162223] intel_pstate: set_policy cpuinfo.max 3000000 policy- >>> max 3000000 >> [ 40.162226] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 >> max_policy_perf:30 >> [ 40.162228] intel_pstate: cpu:0 global_min:8 global_max:30 >> [ 40.162230] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 >> [ 40.162237] CPU 0: _PPC is 6 - frequency limited >> [ 40.162241] intel_pstate: policy->max > max non turbo frequency >> [ 40.162243] intel_pstate: set_policy cpuinfo.max 3000000 policy- >>> max 3000000 >> [ 40.162245] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 >> max_policy_perf:30 >> [ 40.162247] intel_pstate: cpu:0 global_min:8 global_max:30 >> [ 40.162249] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 >> [ 40.162257] CPU 0: _PPC is 6 - frequency limited >> [ 40.162261] intel_pstate: policy->max > max non turbo frequency >> [ 40.162263] intel_pstate: set_policy cpuinfo.max 3000000 policy- >>> max 3000000 >> [ 40.162265] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 >> max_policy_perf:30 >> [ 40.162267] intel_pstate: cpu:0 global_min:8 global_max:30 >> [ 40.162269] intel_pstate: cpu:0 max_perf_ratio:30 min_perf_ratio:8 >> >> Unplugged -> Plugged: >> >> [ 52.648535] CPU 0: _PPC is 6 - frequency limited >> [ 52.648553] intel_pstate: set_policy cpuinfo.max 3000000 policy- >>> max 1700000 >> [ 52.648558] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 >> max_policy_perf:17 >> [ 52.648562] intel_pstate: cpu:0 global_min:8 global_max:30 >> [ 52.648566] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 >> [ 52.648583] CPU 0: _PPC is 6 - frequency limited >> [ 52.648590] intel_pstate: set_policy cpuinfo.max 3000000 policy- >>> max 1700000 >> [ 52.648595] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 >> max_policy_perf:17 >> [ 52.648598] intel_pstate: cpu:0 global_min:8 global_max:30 >> [ 52.648602] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 >> [ 52.656093] CPU 0: _PPC is 6 - frequency limited >> [ 52.656111] intel_pstate: set_policy cpuinfo.max 3000000 policy- >>> max 1700000 >> [ 52.656116] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 >> max_policy_perf:17 >> [ 52.656120] intel_pstate: cpu:0 global_min:8 global_max:30 >> [ 52.656123] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 >> [ 52.775577] CPU 0: _PPC is 6 - frequency limited >> [ 52.775594] intel_pstate: set_policy cpuinfo.max 3000000 policy- >>> max 1700000 >> [ 52.775598] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 >> max_policy_perf:17 >> [ 52.775601] intel_pstate: cpu:0 global_min:8 global_max:30 >> [ 52.775604] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 >> [ 53.028620] CPU 0: _PPC is 6 - frequency limited >> [ 53.028637] intel_pstate: set_policy cpuinfo.max 3000000 policy- >>> max 1700000 >> [ 53.028643] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 >> max_policy_perf:17 >> [ 53.028647] intel_pstate: cpu:0 global_min:8 global_max:30 >> [ 53.028651] intel_pstate: cpu:0 max_perf_ratio:17 min_perf_ratio:8 >> >>> and send dmesg after you change power sources. >>> >>> - Also try with >>> intel_pstate=disable dyndbg="file processor_perflib.c +p" >> >> Nothing gets printed with this one. >> >> Thanks, >> Gabriele >> >>> and send dmesg. >>> >>> Thanks, >>> Srinivas >>> >>> ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Revert "cpufreq: intel_pstate: Fix ->set_policy() interface for no_turbo" 2018-08-07 20:12 ` Gabriele Mazzotta @ 2018-08-07 21:22 ` Srinivas Pandruvada 2018-08-07 22:05 ` Gabriele Mazzotta 0 siblings, 1 reply; 9+ messages in thread From: Srinivas Pandruvada @ 2018-08-07 21:22 UTC (permalink / raw) To: Gabriele Mazzotta, Rafael J. Wysocki Cc: Rafael J. Wysocki, Len Brown, Viresh Kumar, Linux PM, Linux Kernel Mailing List On Tue, 2018-08-07 at 22:12 +0200, Gabriele Mazzotta wrote: > On 07/08/2018 00:11, Srinivas Pandruvada wrote: > > On Mon, 2018-08-06 at 23:50 +0200, Gabriele Mazzotta wrote: > > > On 06/08/2018 18:49, Srinivas Pandruvada wrote: > > > > On Mon, 2018-08-06 at 10:30 +0200, Rafael J. Wysocki wrote: > > > > > On Sat, Aug 4, 2018 at 7:31 PM, Gabriele Mazzotta > > > > > <gabriele.mzt@gmail.com> wrote: > > > > > > On 04/08/2018 17:29, Gabriele Mazzotta wrote: > > > > > > > This change does not take into account that some BIOSes > > > > > > > change > > > > > > > MSR_IA32is getting notified via PPC > > > > > > > change._MISC_ENABLE_TURBO_DISABLE depending on the power > > > > > > > source. > > > > > > > If the turbo is disabled when the system boots, > > > > > > > policy.max_freq > > > > > > > is set to pstate.max_pstate. However, if the BIOS later > > > > > > > enables > > > > > > > the turbo, the CPU will never be able to run at > > > > > > > pstate.turbo_pstate. > > > > > > > is getting notified via PPC change. > > > > > > > Since now intel_pstate_set_policy() does its calculations > > > > > > > using > > > > > > > pstate.max_freq and pstate.turbo_freq, we can always > > > > > > > calculate > > > > > > > cpuinfo.max_freq using pstate.turbo_pstate, thus allowing > > > > > > > system > > > > > > > with varying MSR_IA32_MISC_ENABLE_TURBO_DISABLE to run at > > > > > > > full > > > > > > > speed when the turbo is enabled. > > > > > > > > > > Well, the problem with this approach is that always using > > > > > pstate.turbo_pstate as the max causes the governor to > > > > > overestimate > > > > > the > > > > > target frequency when the turbo range is not available (the > > > > > target > > > > > depends on the width of the entire available P-state range > > > > > including > > > > > turbo, so if the turbo range is not available, the number > > > > > take > > > > > into > > > > > that computation is too large). > > > > > > > > > > Are we expected to get notified when the BIOS updates > > > > > MSR_IA32_MISC_ENABLE_TURBO_DISABLE? > > > > > > > > Let's try this: > > > > - boot with kernel command line > > > > > > > > intel_pstate=support_acpi_ppc dyndbg="file processor_perflib.c > > > > +p" > > > > dyndbg="file intel_pstate.c +p" > > Can you create a bugzilla? In this way easy to exchange attachments. For example in the above command line I was expecting boot up traces from intel_pstate (I need full dmesg). From the log with PPC=6 should correspond to 1.6GHz from acpi dump. Even after power is connected the PPC is still requesting to be 6. I will attach some test patch to bugzilla after checking the full dmesg. turbostat log shoes that turbo was disabled on unplug but it is getting notified via some PPC change. Thanks, Srinivas > > Interesting output. > > Can you run ? > > # turbostat --debug > > in both plugged and unplugged state. > > This is the output of turbostat while plugged in, with > intel_pstate=support_acpi_ppc in the cmdline: > > turbostat version 18.06.20 - Len Brown <lenb@kernel.org> > CPUID(0): GenuineIntel 13 CPUID levels; family:model:stepping > 0x6:45:1 (6:69:1) > CPUID(1): SSE3 MONITOR - EIST TM2 TSC MSR ACPI-TM HT TM > CPUID(6): APERF, TURBO, DTS, PTM, No-HWP, No-HWPnotify, No-HWPwindow, > No-HWPepp, No-HWPpkg, EPB > cpu0: MSR_IA32_MISC_ENABLE: 0x00850089 (TCC EIST MWAIT PREFETCH > TURBO) > CPUID(7): No-SGX > cpu0: MSR_MISC_PWR_MGMT: 0x00400000 (ENable-EIST_Coordination > DISable-EPB DISable-OOB) > RAPL: 17476 sec. Joule Counter Range, at 15 Watts > cpu0: MSR_PLATFORM_INFO: 0x8083df3011800 > 8 * 100.0 = 800.0 MHz max efficiency frequency > 24 * 100.0 = 2400.0 MHz base frequency > cpu0: MSR_IA32_POWER_CTL: 0x0004005d (C1E auto-promotion: DISabled) > cpu0: MSR_TURBO_RATIO_LIMIT: 0x1b1b1b1e > 27 * 100.0 = 2700.0 MHz max turbo 4 active cores > 27 * 100.0 = 2700.0 MHz max turbo 3 active cores > 27 * 100.0 = 2700.0 MHz max turbo 2 active cores > 30 * 100.0 = 3000.0 MHz max turbo 1 active cores > cpu0: MSR_CONFIG_TDP_NOMINAL: 0x00000012 (base_ratio=18) > cpu0: MSR_CONFIG_TDP_LEVEL_1: 0x0008005c (PKG_MIN_PWR_LVL1=0 > PKG_MAX_PWR_LVL1=0 LVL1_RATIO=8 PKG_TDP_LVL1=92) > cpu0: MSR_CONFIG_TDP_LEVEL_2: 0x001800c8 (PKG_MIN_PWR_LVL2=0 > PKG_MAX_PWR_LVL2=0 LVL2_RATIO=24 PKG_TDP_LVL2=200) > cpu0: MSR_CONFIG_TDP_CONTROL: 0x00000000 ( lock=0) > cpu0: MSR_TURBO_ACTIVATION_RATIO: 0x00000011 (MAX_NON_TURBO_RATIO=17 > lock=0) > cpu0: MSR_PKG_CST_CONFIG_CONTROL: 0x1e008407 (UNdemote-C3, UNdemote- > C1, demote-C3, demote-C1, locked, pkg-cstate-limit=7 (pc9)) > cpu0: POLL: CPUIDLE CORE POLL IDLE > cpu0: C1: MWAIT 0x00 > cpu0: C1E: MWAIT 0x01 > cpu0: C3: MWAIT 0x10 > cpu0: C6: MWAIT 0x20 > cpu0: C7s: MWAIT 0x32 > cpu0: C8: MWAIT 0x40 > cpu0: C9: MWAIT 0x50 > cpu0: C10: MWAIT 0x60 > cpu0: cpufreq driver: intel_pstate > cpu0: cpufreq governor: powersave > cpufreq intel_pstate no_turbo: 0 > cpu0: MSR_MISC_FEATURE_CONTROL: 0x00000000 (L2-Prefetch L2-Prefetch- > pair L1-Prefetch L1-IP-Prefetch) > cpu0: MSR_IA32_ENERGY_PERF_BIAS: 0x00000006 (balanced) > cpu0: MSR_CORE_PERF_LIMIT_REASONS, 0x1d210020 (Active: Auto-HWP, ) > (Logged: MultiCoreTurbo, PkgPwrL2, PkgPwrL1, Amps, Auto-HWP, PROCHOT, > ) > cpu0: MSR_GFX_PERF_LIMIT_REASONS, 0x1c010000 (Active: ) (Logged: > PROCHOT, PkgPwrL1, PkgPwrL2, ) > cpu0: MSR_RING_PERF_LIMIT_REASONS, 0x0d010000 (Active: ) (Logged: > PROCHOT, Amps, PkgPwrL1, PkgPwrL2, ) > cpu0: MSR_RAPL_POWER_UNIT: 0x000a0e03 (0.125000 Watts, 0.000061 > Joules, 0.000977 sec.) > cpu0: MSR_PKG_POWER_INFO: 0x00000078 (15 W TDP, RAPL 0 - 0 W, > 0.000000 sec.) > cpu0: MSR_PKG_POWER_LIMIT: 0x420078001480c8 (UNlocked) > cpu0: PKG Limit #1: ENabled (25.000000 Watts, 1.000000 sec, clamp > DISabled) > cpu0: PKG Limit #2: DISabled (15.000000 Watts, 0.002441* sec, clamp > DISabled) > cpu0: MSR_PP0_POLICY: 0 > cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked) > cpu0: Cores Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp > DISabled) > cpu0: MSR_PP1_POLICY: 0 > cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked) > cpu0: GFX Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp > DISabled) > cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x00640000 (100 C) > cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x882d0808 (55 C) > cpu0: MSR_IA32_PACKAGE_THERM_INTERRUPT: 0x00000003 (100 C, 100 C) > cpu0: MSR_IA32_THERM_STATUS: 0x882d0808 (55 C +/- 1) > cpu0: MSR_IA32_THERM_INTERRUPT: 0x00000013 (100 C, 100 C) > cpu2: MSR_IA32_THERM_STATUS: 0x88300808 (52 C +/- 1) > cpu2: MSR_IA32_THERM_INTERRUPT: 0x00000013 (100 C, 100 C) > cpu0: MSR_PKGC3_IRTL: 0x00008842 (valid, 67584 ns) > cpu0: MSR_PKGC6_IRTL: 0x00008873 (valid, 117760 ns) > cpu0: MSR_PKGC7_IRTL: 0x00008891 (valid, 148480 ns) > cpu0: MSR_PKGC8_IRTL: 0x000088e4 (valid, 233472 ns) > cpu0: MSR_PKGC9_IRTL: 0x00008945 (valid, 332800 ns) > cpu0: MSR_PKGC10_IRTL: 0x00009003 (valid, 3 ns) > > > And this is what I get after I unplug the laptop: > > turbostat version 18.06.20 - Len Brown <lenb@kernel.org> > CPUID(0): GenuineIntel 13 CPUID levels; family:model:stepping > 0x6:45:1 (6:69:1) > CPUID(1): SSE3 MONITOR - EIST TM2 TSC MSR ACPI-TM HT TM > CPUID(6): APERF, No-TURBO, DTS, PTM, No-HWP, No-HWPnotify, No- > HWPwindow, No-HWPepp, No-HWPpkg, EPB > cpu3: MSR_IA32_MISC_ENABLE: 0x4000850089 (TCC EIST MWAIT PREFETCH No- > TURBO) > CPUID(7): No-SGX > cpu3: MSR_MISC_PWR_MGMT: 0x00400000 (ENable-EIST_Coordination > DISable-EPB DISable-OOB) > RAPL: 17476 sec. Joule Counter Range, at 15 Watts > cpu3: MSR_PLATFORM_INFO: 0x8083df3011800 > 8 * 100.0 = 800.0 MHz max efficiency frequency > 24 * 100.0 = 2400.0 MHz base frequency > cpu3: MSR_IA32_POWER_CTL: 0x0004005d (C1E auto-promotion: DISabled) > cpu3: MSR_TURBO_RATIO_LIMIT: 0x1b1b1b1e > 27 * 100.0 = 2700.0 MHz max turbo 4 active cores > 27 * 100.0 = 2700.0 MHz max turbo 3 active cores > 27 * 100.0 = 2700.0 MHz max turbo 2 active cores > 30 * 100.0 = 3000.0 MHz max turbo 1 active cores > cpu3: MSR_CONFIG_TDP_NOMINAL: 0x00000012 (base_ratio=18) > cpu3: MSR_CONFIG_TDP_LEVEL_1: 0x0008005c (PKG_MIN_PWR_LVL1=0 > PKG_MAX_PWR_LVL1=0 LVL1_RATIO=8 PKG_TDP_LVL1=92) > cpu3: MSR_CONFIG_TDP_LEVEL_2: 0x001800c8 (PKG_MIN_PWR_LVL2=0 > PKG_MAX_PWR_LVL2=0 LVL2_RATIO=24 PKG_TDP_LVL2=200) > cpu3: MSR_CONFIG_TDP_CONTROL: 0x00000000 ( lock=0) > cpu3: MSR_TURBO_ACTIVATION_RATIO: 0x00000011 (MAX_NON_TURBO_RATIO=17 > lock=0) > cpu3: MSR_PKG_CST_CONFIG_CONTROL: 0x1e008407 (UNdemote-C3, UNdemote- > C1, demote-C3, demote-C1, locked, pkg-cstate-limit=7 (pc9)) > cpu3: POLL: CPUIDLE CORE POLL IDLE > cpu3: C1: MWAIT 0x00 > cpu3: C1E: MWAIT 0x01 > cpu3: C3: MWAIT 0x10 > cpu3: C6: MWAIT 0x20 > cpu3: C7s: MWAIT 0x32 > cpu3: C8: MWAIT 0x40 > cpu3: C9: MWAIT 0x50 > cpu3: C10: MWAIT 0x60 > cpu3: cpufreq driver: intel_pstate > cpu3: cpufreq governor: powersave > cpufreq intel_pstate no_turbo: 1 > cpu3: MSR_MISC_FEATURE_CONTROL: 0x00000000 (L2-Prefetch L2-Prefetch- > pair L1-Prefetch L1-IP-Prefetch) > cpu0: MSR_IA32_ENERGY_PERF_BIAS: 0x00000006 (balanced) > cpu0: MSR_CORE_PERF_LIMIT_REASONS, 0x1d210000 (Active: ) (Logged: > MultiCoreTurbo, PkgPwrL2, PkgPwrL1, Amps, Auto-HWP, PROCHOT, ) > cpu0: MSR_GFX_PERF_LIMIT_REASONS, 0x1c010000 (Active: ) (Logged: > PROCHOT, PkgPwrL1, PkgPwrL2, ) > cpu0: MSR_RING_PERF_LIMIT_REASONS, 0x0d010000 (Active: ) (Logged: > PROCHOT, Amps, PkgPwrL1, PkgPwrL2, ) > cpu0: MSR_RAPL_POWER_UNIT: 0x000a0e03 (0.125000 Watts, 0.000061 > Joules, 0.000977 sec.) > cpu0: MSR_PKG_POWER_INFO: 0x00000078 (15 W TDP, RAPL 0 - 0 W, > 0.000000 sec.) > cpu0: MSR_PKG_POWER_LIMIT: 0x420078001480c8 (UNlocked) > cpu0: PKG Limit #1: ENabled (25.000000 Watts, 1.000000 sec, clamp > DISabled) > cpu0: PKG Limit #2: DISabled (15.000000 Watts, 0.002441* sec, clamp > DISabled) > cpu0: MSR_PP0_POLICY: 0 > cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked) > cpu0: Cores Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp > DISabled) > cpu0: MSR_PP1_POLICY: 0 > cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked) > cpu0: GFX Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp > DISabled) > cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x00640000 (100 C) > cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x882f0808 (53 C) > cpu0: MSR_IA32_PACKAGE_THERM_INTERRUPT: 0x00000003 (100 C, 100 C) > cpu0: MSR_IA32_THERM_STATUS: 0x882f0808 (53 C +/- 1) > cpu0: MSR_IA32_THERM_INTERRUPT: 0x00000013 (100 C, 100 C) > cpu2: MSR_IA32_THERM_STATUS: 0x88300808 (52 C +/- 1) > cpu2: MSR_IA32_THERM_INTERRUPT: 0x00000013 (100 C, 100 C) > cpu3: MSR_PKGC3_IRTL: 0x00008842 (valid, 67584 ns) > cpu3: MSR_PKGC6_IRTL: 0x00008873 (valid, 117760 ns) > cpu3: MSR_PKGC7_IRTL: 0x00008891 (valid, 148480 ns) > cpu3: MSR_PKGC8_IRTL: 0x000088e4 (valid, 233472 ns) > cpu3: MSR_PKGC9_IRTL: 0x00008945 (valid, 332800 ns) > cpu3: MSR_PKGC10_IRTL: 0x00009003 (valid, 3 ns) > > > MSR_CORE_PERF_LIMIT_REASONS seems to have a different value > when plugged in depending on how the laptop booted. I don't > know if this is relevant, but this is what I noticed. > > Right after a reboot while plugged in, I get: > cpu0: MSR_CORE_PERF_LIMIT_REASONS, 0x1d201000 (Active: > MultiCoreTurbo, ) (Logged: MultiCoreTurbo, PkgPwrL2, PkgPwrL1, Amps, > Auto-HWP, ) > If unplug and replug, I get: > cpu0: MSR_CORE_PERF_LIMIT_REASONS, 0x1d210020 (Active: Auto-HWP, ) > (Logged: MultiCoreTurbo, PkgPwrL2, PkgPwrL1, Amps, Auto-HWP, PROCHOT, > ) > > If the laptop booted while unplgged, I constantly get: > cpu0: MSR_CORE_PERF_LIMIT_REASONS, 0x14000000 (Active: ) (Logged: > MultiCoreTurbo, PkgPwrL1, ) > > > > Also output of acpidump? > > You can find it here: > https://bugzilla.kernel.org/attachment.cgi?id=178381 > > > > > > Plugged -> Unplugged: > > > > > > [ 40.046116] CPU 0: _PPC is 6 - frequency limited > > > [ 40.046128] intel_pstate: policy->max > max non turbo > > > frequency > > > [ 40.046131] intel_pstate: set_policy cpuinfo.max 3000000 > > > policy- > > > > max 3000000 > > > > > > [ 40.046134] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 > > > max_policy_perf:30 > > > [ 40.046137] intel_pstate: cpu:0 global_min:8 global_max:30 > > > [ 40.046140] intel_pstate: cpu:0 max_perf_ratio:30 > > > min_perf_ratio:8 > > > [ 40.162173] CPU 0: _PPC is 6 - frequency limited > > > [ 40.162186] intel_pstate: policy->max > max non turbo > > > frequency > > > [ 40.162190] intel_pstate: set_policy cpuinfo.max 3000000 > > > policy- > > > > max 3000000 > > > > > > [ 40.162194] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 > > > max_policy_perf:30 > > > [ 40.162197] intel_pstate: cpu:0 global_min:8 global_max:30 > > > [ 40.162200] intel_pstate: cpu:0 max_perf_ratio:30 > > > min_perf_ratio:8 > > > [ 40.162215] CPU 0: _PPC is 6 - frequency limited > > > [ 40.162220] intel_pstate: policy->max > max non turbo > > > frequency > > > [ 40.162223] intel_pstate: set_policy cpuinfo.max 3000000 > > > policy- > > > > max 3000000 > > > > > > [ 40.162226] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 > > > max_policy_perf:30 > > > [ 40.162228] intel_pstate: cpu:0 global_min:8 global_max:30 > > > [ 40.162230] intel_pstate: cpu:0 max_perf_ratio:30 > > > min_perf_ratio:8 > > > [ 40.162237] CPU 0: _PPC is 6 - frequency limited > > > [ 40.162241] intel_pstate: policy->max > max non turbo > > > frequency > > > [ 40.162243] intel_pstate: set_policy cpuinfo.max 3000000 > > > policy- > > > > max 3000000 > > > > > > [ 40.162245] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 > > > max_policy_perf:30 > > > [ 40.162247] intel_pstate: cpu:0 global_min:8 global_max:30 > > > [ 40.162249] intel_pstate: cpu:0 max_perf_ratio:30 > > > min_perf_ratio:8 > > > [ 40.162257] CPU 0: _PPC is 6 - frequency limited > > > [ 40.162261] intel_pstate: policy->max > max non turbo > > > frequency > > > [ 40.162263] intel_pstate: set_policy cpuinfo.max 3000000 > > > policy- > > > > max 3000000 > > > > > > [ 40.162265] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 > > > max_policy_perf:30 > > > [ 40.162267] intel_pstate: cpu:0 global_min:8 global_max:30 > > > [ 40.162269] intel_pstate: cpu:0 max_perf_ratio:30 > > > min_perf_ratio:8 > > > > > > Unplugged -> Plugged: > > > > > > [ 52.648535] CPU 0: _PPC is 6 - frequency limited > > > [ 52.648553] intel_pstate: set_policy cpuinfo.max 3000000 > > > policy- > > > > max 1700000 > > > > > > [ 52.648558] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 > > > max_policy_perf:17 > > > [ 52.648562] intel_pstate: cpu:0 global_min:8 global_max:30 > > > [ 52.648566] intel_pstate: cpu:0 max_perf_ratio:17 > > > min_perf_ratio:8 > > > [ 52.648583] CPU 0: _PPC is 6 - frequency limited > > > [ 52.648590] intel_pstate: set_policy cpuinfo.max 3000000 > > > policy- > > > > max 1700000 > > > > > > [ 52.648595] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 > > > max_policy_perf:17 > > > [ 52.648598] intel_pstate: cpu:0 global_min:8 global_max:30 > > > [ 52.648602] intel_pstate: cpu:0 max_perf_ratio:17 > > > min_perf_ratio:8 > > > [ 52.656093] CPU 0: _PPC is 6 - frequency limited > > > [ 52.656111] intel_pstate: set_policy cpuinfo.max 3000000 > > > policy- > > > > max 1700000 > > > > > > [ 52.656116] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 > > > max_policy_perf:17 > > > [ 52.656120] intel_pstate: cpu:0 global_min:8 global_max:30 > > > [ 52.656123] intel_pstate: cpu:0 max_perf_ratio:17 > > > min_perf_ratio:8 > > > [ 52.775577] CPU 0: _PPC is 6 - frequency limited > > > [ 52.775594] intel_pstate: set_policy cpuinfo.max 3000000 > > > policy- > > > > max 1700000 > > > > > > [ 52.775598] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 > > > max_policy_perf:17 > > > [ 52.775601] intel_pstate: cpu:0 global_min:8 global_max:30 > > > [ 52.775604] intel_pstate: cpu:0 max_perf_ratio:17 > > > min_perf_ratio:8 > > > [ 53.028620] CPU 0: _PPC is 6 - frequency limited > > > [ 53.028637] intel_pstate: set_policy cpuinfo.max 3000000 > > > policy- > > > > max 1700000 > > > > > > [ 53.028643] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 > > > max_policy_perf:17 > > > [ 53.028647] intel_pstate: cpu:0 global_min:8 global_max:30 > > > [ 53.028651] intel_pstate: cpu:0 max_perf_ratio:17 > > > min_perf_ratio:8 > > > > > > > and send dmesg after you change power sources. > > > > > > > > - Also try with > > > > intel_pstate=disable dyndbg="file processor_perflib.c +p" > > > > > > Nothing gets printed with this one. > > > > > > Thanks, > > > Gabriele > > > > > > > and send dmesg. > > > > > > > > Thanks, > > > > Srinivas > > > > > > > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Revert "cpufreq: intel_pstate: Fix ->set_policy() interface for no_turbo" 2018-08-07 21:22 ` Srinivas Pandruvada @ 2018-08-07 22:05 ` Gabriele Mazzotta 0 siblings, 0 replies; 9+ messages in thread From: Gabriele Mazzotta @ 2018-08-07 22:05 UTC (permalink / raw) To: Srinivas Pandruvada, Rafael J. Wysocki Cc: Rafael J. Wysocki, Len Brown, Viresh Kumar, Linux PM, Linux Kernel Mailing List On 07/08/2018 23:22, Srinivas Pandruvada wrote: > On Tue, 2018-08-07 at 22:12 +0200, Gabriele Mazzotta wrote: >> On 07/08/2018 00:11, Srinivas Pandruvada wrote: >>> On Mon, 2018-08-06 at 23:50 +0200, Gabriele Mazzotta wrote: >>>> On 06/08/2018 18:49, Srinivas Pandruvada wrote: >>>>> On Mon, 2018-08-06 at 10:30 +0200, Rafael J. Wysocki wrote: >>>>>> On Sat, Aug 4, 2018 at 7:31 PM, Gabriele Mazzotta >>>>>> <gabriele.mzt@gmail.com> wrote: >>>>>>> On 04/08/2018 17:29, Gabriele Mazzotta wrote: >>>>>>>> This change does not take into account that some BIOSes >>>>>>>> change >>>>>>>> MSR_IA32is getting notified via PPC >>>>>>>> change._MISC_ENABLE_TURBO_DISABLE depending on the power >>>>>>>> source. >>>>>>>> If the turbo is disabled when the system boots, >>>>>>>> policy.max_freq >>>>>>>> is set to pstate.max_pstate. However, if the BIOS later >>>>>>>> enables >>>>>>>> the turbo, the CPU will never be able to run at >>>>>>>> pstate.turbo_pstate. >>>>>>>> is getting notified via PPC change. >>>>>>>> Since now intel_pstate_set_policy() does its calculations >>>>>>>> using >>>>>>>> pstate.max_freq and pstate.turbo_freq, we can always >>>>>>>> calculate >>>>>>>> cpuinfo.max_freq using pstate.turbo_pstate, thus allowing >>>>>>>> system >>>>>>>> with varying MSR_IA32_MISC_ENABLE_TURBO_DISABLE to run at >>>>>>>> full >>>>>>>> speed when the turbo is enabled. >>>>>> >>>>>> Well, the problem with this approach is that always using >>>>>> pstate.turbo_pstate as the max causes the governor to >>>>>> overestimate >>>>>> the >>>>>> target frequency when the turbo range is not available (the >>>>>> target >>>>>> depends on the width of the entire available P-state range >>>>>> including >>>>>> turbo, so if the turbo range is not available, the number >>>>>> take >>>>>> into >>>>>> that computation is too large). >>>>>> >>>>>> Are we expected to get notified when the BIOS updates >>>>>> MSR_IA32_MISC_ENABLE_TURBO_DISABLE? >>>>> >>>>> Let's try this: >>>>> - boot with kernel command line >>>>> >>>>> intel_pstate=support_acpi_ppc dyndbg="file processor_perflib.c >>>>> +p" >>>>> dyndbg="file intel_pstate.c +p" >>> > Can you create a bugzilla? In this way easy to exchange attachments. > For example in the above command line I was expecting boot up traces > from intel_pstate (I need full dmesg). From the log with PPC=6 should > correspond to 1.6GHz from acpi dump. > Even after power is connected the PPC is still requesting to be 6. > > I will attach some test patch to bugzilla after checking the full > dmesg. Done: https://bugzilla.kernel.org/show_bug.cgi?id=200759 Gabriele > > turbostat log shoes that turbo was disabled on unplug but it is getting > notified via some PPC change. > > Thanks, > Srinivas > >>> Interesting output. >>> Can you run ? >>> # turbostat --debug >>> in both plugged and unplugged state. >> >> This is the output of turbostat while plugged in, with >> intel_pstate=support_acpi_ppc in the cmdline: >> >> turbostat version 18.06.20 - Len Brown <lenb@kernel.org> >> CPUID(0): GenuineIntel 13 CPUID levels; family:model:stepping >> 0x6:45:1 (6:69:1) >> CPUID(1): SSE3 MONITOR - EIST TM2 TSC MSR ACPI-TM HT TM >> CPUID(6): APERF, TURBO, DTS, PTM, No-HWP, No-HWPnotify, No-HWPwindow, >> No-HWPepp, No-HWPpkg, EPB >> cpu0: MSR_IA32_MISC_ENABLE: 0x00850089 (TCC EIST MWAIT PREFETCH >> TURBO) >> CPUID(7): No-SGX >> cpu0: MSR_MISC_PWR_MGMT: 0x00400000 (ENable-EIST_Coordination >> DISable-EPB DISable-OOB) >> RAPL: 17476 sec. Joule Counter Range, at 15 Watts >> cpu0: MSR_PLATFORM_INFO: 0x8083df3011800 >> 8 * 100.0 = 800.0 MHz max efficiency frequency >> 24 * 100.0 = 2400.0 MHz base frequency >> cpu0: MSR_IA32_POWER_CTL: 0x0004005d (C1E auto-promotion: DISabled) >> cpu0: MSR_TURBO_RATIO_LIMIT: 0x1b1b1b1e >> 27 * 100.0 = 2700.0 MHz max turbo 4 active cores >> 27 * 100.0 = 2700.0 MHz max turbo 3 active cores >> 27 * 100.0 = 2700.0 MHz max turbo 2 active cores >> 30 * 100.0 = 3000.0 MHz max turbo 1 active cores >> cpu0: MSR_CONFIG_TDP_NOMINAL: 0x00000012 (base_ratio=18) >> cpu0: MSR_CONFIG_TDP_LEVEL_1: 0x0008005c (PKG_MIN_PWR_LVL1=0 >> PKG_MAX_PWR_LVL1=0 LVL1_RATIO=8 PKG_TDP_LVL1=92) >> cpu0: MSR_CONFIG_TDP_LEVEL_2: 0x001800c8 (PKG_MIN_PWR_LVL2=0 >> PKG_MAX_PWR_LVL2=0 LVL2_RATIO=24 PKG_TDP_LVL2=200) >> cpu0: MSR_CONFIG_TDP_CONTROL: 0x00000000 ( lock=0) >> cpu0: MSR_TURBO_ACTIVATION_RATIO: 0x00000011 (MAX_NON_TURBO_RATIO=17 >> lock=0) >> cpu0: MSR_PKG_CST_CONFIG_CONTROL: 0x1e008407 (UNdemote-C3, UNdemote- >> C1, demote-C3, demote-C1, locked, pkg-cstate-limit=7 (pc9)) >> cpu0: POLL: CPUIDLE CORE POLL IDLE >> cpu0: C1: MWAIT 0x00 >> cpu0: C1E: MWAIT 0x01 >> cpu0: C3: MWAIT 0x10 >> cpu0: C6: MWAIT 0x20 >> cpu0: C7s: MWAIT 0x32 >> cpu0: C8: MWAIT 0x40 >> cpu0: C9: MWAIT 0x50 >> cpu0: C10: MWAIT 0x60 >> cpu0: cpufreq driver: intel_pstate >> cpu0: cpufreq governor: powersave >> cpufreq intel_pstate no_turbo: 0 >> cpu0: MSR_MISC_FEATURE_CONTROL: 0x00000000 (L2-Prefetch L2-Prefetch- >> pair L1-Prefetch L1-IP-Prefetch) >> cpu0: MSR_IA32_ENERGY_PERF_BIAS: 0x00000006 (balanced) >> cpu0: MSR_CORE_PERF_LIMIT_REASONS, 0x1d210020 (Active: Auto-HWP, ) >> (Logged: MultiCoreTurbo, PkgPwrL2, PkgPwrL1, Amps, Auto-HWP, PROCHOT, >> ) >> cpu0: MSR_GFX_PERF_LIMIT_REASONS, 0x1c010000 (Active: ) (Logged: >> PROCHOT, PkgPwrL1, PkgPwrL2, ) >> cpu0: MSR_RING_PERF_LIMIT_REASONS, 0x0d010000 (Active: ) (Logged: >> PROCHOT, Amps, PkgPwrL1, PkgPwrL2, ) >> cpu0: MSR_RAPL_POWER_UNIT: 0x000a0e03 (0.125000 Watts, 0.000061 >> Joules, 0.000977 sec.) >> cpu0: MSR_PKG_POWER_INFO: 0x00000078 (15 W TDP, RAPL 0 - 0 W, >> 0.000000 sec.) >> cpu0: MSR_PKG_POWER_LIMIT: 0x420078001480c8 (UNlocked) >> cpu0: PKG Limit #1: ENabled (25.000000 Watts, 1.000000 sec, clamp >> DISabled) >> cpu0: PKG Limit #2: DISabled (15.000000 Watts, 0.002441* sec, clamp >> DISabled) >> cpu0: MSR_PP0_POLICY: 0 >> cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked) >> cpu0: Cores Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp >> DISabled) >> cpu0: MSR_PP1_POLICY: 0 >> cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked) >> cpu0: GFX Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp >> DISabled) >> cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x00640000 (100 C) >> cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x882d0808 (55 C) >> cpu0: MSR_IA32_PACKAGE_THERM_INTERRUPT: 0x00000003 (100 C, 100 C) >> cpu0: MSR_IA32_THERM_STATUS: 0x882d0808 (55 C +/- 1) >> cpu0: MSR_IA32_THERM_INTERRUPT: 0x00000013 (100 C, 100 C) >> cpu2: MSR_IA32_THERM_STATUS: 0x88300808 (52 C +/- 1) >> cpu2: MSR_IA32_THERM_INTERRUPT: 0x00000013 (100 C, 100 C) >> cpu0: MSR_PKGC3_IRTL: 0x00008842 (valid, 67584 ns) >> cpu0: MSR_PKGC6_IRTL: 0x00008873 (valid, 117760 ns) >> cpu0: MSR_PKGC7_IRTL: 0x00008891 (valid, 148480 ns) >> cpu0: MSR_PKGC8_IRTL: 0x000088e4 (valid, 233472 ns) >> cpu0: MSR_PKGC9_IRTL: 0x00008945 (valid, 332800 ns) >> cpu0: MSR_PKGC10_IRTL: 0x00009003 (valid, 3 ns) >> >> >> And this is what I get after I unplug the laptop: >> >> turbostat version 18.06.20 - Len Brown <lenb@kernel.org> >> CPUID(0): GenuineIntel 13 CPUID levels; family:model:stepping >> 0x6:45:1 (6:69:1) >> CPUID(1): SSE3 MONITOR - EIST TM2 TSC MSR ACPI-TM HT TM >> CPUID(6): APERF, No-TURBO, DTS, PTM, No-HWP, No-HWPnotify, No- >> HWPwindow, No-HWPepp, No-HWPpkg, EPB >> cpu3: MSR_IA32_MISC_ENABLE: 0x4000850089 (TCC EIST MWAIT PREFETCH No- >> TURBO) >> CPUID(7): No-SGX >> cpu3: MSR_MISC_PWR_MGMT: 0x00400000 (ENable-EIST_Coordination >> DISable-EPB DISable-OOB) >> RAPL: 17476 sec. Joule Counter Range, at 15 Watts >> cpu3: MSR_PLATFORM_INFO: 0x8083df3011800 >> 8 * 100.0 = 800.0 MHz max efficiency frequency >> 24 * 100.0 = 2400.0 MHz base frequency >> cpu3: MSR_IA32_POWER_CTL: 0x0004005d (C1E auto-promotion: DISabled) >> cpu3: MSR_TURBO_RATIO_LIMIT: 0x1b1b1b1e >> 27 * 100.0 = 2700.0 MHz max turbo 4 active cores >> 27 * 100.0 = 2700.0 MHz max turbo 3 active cores >> 27 * 100.0 = 2700.0 MHz max turbo 2 active cores >> 30 * 100.0 = 3000.0 MHz max turbo 1 active cores >> cpu3: MSR_CONFIG_TDP_NOMINAL: 0x00000012 (base_ratio=18) >> cpu3: MSR_CONFIG_TDP_LEVEL_1: 0x0008005c (PKG_MIN_PWR_LVL1=0 >> PKG_MAX_PWR_LVL1=0 LVL1_RATIO=8 PKG_TDP_LVL1=92) >> cpu3: MSR_CONFIG_TDP_LEVEL_2: 0x001800c8 (PKG_MIN_PWR_LVL2=0 >> PKG_MAX_PWR_LVL2=0 LVL2_RATIO=24 PKG_TDP_LVL2=200) >> cpu3: MSR_CONFIG_TDP_CONTROL: 0x00000000 ( lock=0) >> cpu3: MSR_TURBO_ACTIVATION_RATIO: 0x00000011 (MAX_NON_TURBO_RATIO=17 >> lock=0) >> cpu3: MSR_PKG_CST_CONFIG_CONTROL: 0x1e008407 (UNdemote-C3, UNdemote- >> C1, demote-C3, demote-C1, locked, pkg-cstate-limit=7 (pc9)) >> cpu3: POLL: CPUIDLE CORE POLL IDLE >> cpu3: C1: MWAIT 0x00 >> cpu3: C1E: MWAIT 0x01 >> cpu3: C3: MWAIT 0x10 >> cpu3: C6: MWAIT 0x20 >> cpu3: C7s: MWAIT 0x32 >> cpu3: C8: MWAIT 0x40 >> cpu3: C9: MWAIT 0x50 >> cpu3: C10: MWAIT 0x60 >> cpu3: cpufreq driver: intel_pstate >> cpu3: cpufreq governor: powersave >> cpufreq intel_pstate no_turbo: 1 >> cpu3: MSR_MISC_FEATURE_CONTROL: 0x00000000 (L2-Prefetch L2-Prefetch- >> pair L1-Prefetch L1-IP-Prefetch) >> cpu0: MSR_IA32_ENERGY_PERF_BIAS: 0x00000006 (balanced) >> cpu0: MSR_CORE_PERF_LIMIT_REASONS, 0x1d210000 (Active: ) (Logged: >> MultiCoreTurbo, PkgPwrL2, PkgPwrL1, Amps, Auto-HWP, PROCHOT, ) >> cpu0: MSR_GFX_PERF_LIMIT_REASONS, 0x1c010000 (Active: ) (Logged: >> PROCHOT, PkgPwrL1, PkgPwrL2, ) >> cpu0: MSR_RING_PERF_LIMIT_REASONS, 0x0d010000 (Active: ) (Logged: >> PROCHOT, Amps, PkgPwrL1, PkgPwrL2, ) >> cpu0: MSR_RAPL_POWER_UNIT: 0x000a0e03 (0.125000 Watts, 0.000061 >> Joules, 0.000977 sec.) >> cpu0: MSR_PKG_POWER_INFO: 0x00000078 (15 W TDP, RAPL 0 - 0 W, >> 0.000000 sec.) >> cpu0: MSR_PKG_POWER_LIMIT: 0x420078001480c8 (UNlocked) >> cpu0: PKG Limit #1: ENabled (25.000000 Watts, 1.000000 sec, clamp >> DISabled) >> cpu0: PKG Limit #2: DISabled (15.000000 Watts, 0.002441* sec, clamp >> DISabled) >> cpu0: MSR_PP0_POLICY: 0 >> cpu0: MSR_PP0_POWER_LIMIT: 0x00000000 (UNlocked) >> cpu0: Cores Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp >> DISabled) >> cpu0: MSR_PP1_POLICY: 0 >> cpu0: MSR_PP1_POWER_LIMIT: 0x00000000 (UNlocked) >> cpu0: GFX Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp >> DISabled) >> cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x00640000 (100 C) >> cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x882f0808 (53 C) >> cpu0: MSR_IA32_PACKAGE_THERM_INTERRUPT: 0x00000003 (100 C, 100 C) >> cpu0: MSR_IA32_THERM_STATUS: 0x882f0808 (53 C +/- 1) >> cpu0: MSR_IA32_THERM_INTERRUPT: 0x00000013 (100 C, 100 C) >> cpu2: MSR_IA32_THERM_STATUS: 0x88300808 (52 C +/- 1) >> cpu2: MSR_IA32_THERM_INTERRUPT: 0x00000013 (100 C, 100 C) >> cpu3: MSR_PKGC3_IRTL: 0x00008842 (valid, 67584 ns) >> cpu3: MSR_PKGC6_IRTL: 0x00008873 (valid, 117760 ns) >> cpu3: MSR_PKGC7_IRTL: 0x00008891 (valid, 148480 ns) >> cpu3: MSR_PKGC8_IRTL: 0x000088e4 (valid, 233472 ns) >> cpu3: MSR_PKGC9_IRTL: 0x00008945 (valid, 332800 ns) >> cpu3: MSR_PKGC10_IRTL: 0x00009003 (valid, 3 ns) >> >> >> MSR_CORE_PERF_LIMIT_REASONS seems to have a different value >> when plugged in depending on how the laptop booted. I don't >> know if this is relevant, but this is what I noticed. >> >> Right after a reboot while plugged in, I get: >> cpu0: MSR_CORE_PERF_LIMIT_REASONS, 0x1d201000 (Active: >> MultiCoreTurbo, ) (Logged: MultiCoreTurbo, PkgPwrL2, PkgPwrL1, Amps, >> Auto-HWP, ) >> If unplug and replug, I get: >> cpu0: MSR_CORE_PERF_LIMIT_REASONS, 0x1d210020 (Active: Auto-HWP, ) >> (Logged: MultiCoreTurbo, PkgPwrL2, PkgPwrL1, Amps, Auto-HWP, PROCHOT, >> ) >> >> If the laptop booted while unplgged, I constantly get: >> cpu0: MSR_CORE_PERF_LIMIT_REASONS, 0x14000000 (Active: ) (Logged: >> MultiCoreTurbo, PkgPwrL1, ) >> >> >>> Also output of acpidump? >> >> You can find it here: >> https://bugzilla.kernel.org/attachment.cgi?id=178381 >> >>> >>>> Plugged -> Unplugged: >>>> >>>> [ 40.046116] CPU 0: _PPC is 6 - frequency limited >>>> [ 40.046128] intel_pstate: policy->max > max non turbo >>>> frequency >>>> [ 40.046131] intel_pstate: set_policy cpuinfo.max 3000000 >>>> policy- >>>>> max 3000000 >>>> >>>> [ 40.046134] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 >>>> max_policy_perf:30 >>>> [ 40.046137] intel_pstate: cpu:0 global_min:8 global_max:30 >>>> [ 40.046140] intel_pstate: cpu:0 max_perf_ratio:30 >>>> min_perf_ratio:8 >>>> [ 40.162173] CPU 0: _PPC is 6 - frequency limited >>>> [ 40.162186] intel_pstate: policy->max > max non turbo >>>> frequency >>>> [ 40.162190] intel_pstate: set_policy cpuinfo.max 3000000 >>>> policy- >>>>> max 3000000 >>>> >>>> [ 40.162194] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 >>>> max_policy_perf:30 >>>> [ 40.162197] intel_pstate: cpu:0 global_min:8 global_max:30 >>>> [ 40.162200] intel_pstate: cpu:0 max_perf_ratio:30 >>>> min_perf_ratio:8 >>>> [ 40.162215] CPU 0: _PPC is 6 - frequency limited >>>> [ 40.162220] intel_pstate: policy->max > max non turbo >>>> frequency >>>> [ 40.162223] intel_pstate: set_policy cpuinfo.max 3000000 >>>> policy- >>>>> max 3000000 >>>> >>>> [ 40.162226] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 >>>> max_policy_perf:30 >>>> [ 40.162228] intel_pstate: cpu:0 global_min:8 global_max:30 >>>> [ 40.162230] intel_pstate: cpu:0 max_perf_ratio:30 >>>> min_perf_ratio:8 >>>> [ 40.162237] CPU 0: _PPC is 6 - frequency limited >>>> [ 40.162241] intel_pstate: policy->max > max non turbo >>>> frequency >>>> [ 40.162243] intel_pstate: set_policy cpuinfo.max 3000000 >>>> policy- >>>>> max 3000000 >>>> >>>> [ 40.162245] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 >>>> max_policy_perf:30 >>>> [ 40.162247] intel_pstate: cpu:0 global_min:8 global_max:30 >>>> [ 40.162249] intel_pstate: cpu:0 max_perf_ratio:30 >>>> min_perf_ratio:8 >>>> [ 40.162257] CPU 0: _PPC is 6 - frequency limited >>>> [ 40.162261] intel_pstate: policy->max > max non turbo >>>> frequency >>>> [ 40.162263] intel_pstate: set_policy cpuinfo.max 3000000 >>>> policy- >>>>> max 3000000 >>>> >>>> [ 40.162265] intel_pstate: cpu:0 max_state 30 min_policy_perf:8 >>>> max_policy_perf:30 >>>> [ 40.162267] intel_pstate: cpu:0 global_min:8 global_max:30 >>>> [ 40.162269] intel_pstate: cpu:0 max_perf_ratio:30 >>>> min_perf_ratio:8 >>>> >>>> Unplugged -> Plugged: >>>> >>>> [ 52.648535] CPU 0: _PPC is 6 - frequency limited >>>> [ 52.648553] intel_pstate: set_policy cpuinfo.max 3000000 >>>> policy- >>>>> max 1700000 >>>> >>>> [ 52.648558] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 >>>> max_policy_perf:17 >>>> [ 52.648562] intel_pstate: cpu:0 global_min:8 global_max:30 >>>> [ 52.648566] intel_pstate: cpu:0 max_perf_ratio:17 >>>> min_perf_ratio:8 >>>> [ 52.648583] CPU 0: _PPC is 6 - frequency limited >>>> [ 52.648590] intel_pstate: set_policy cpuinfo.max 3000000 >>>> policy- >>>>> max 1700000 >>>> >>>> [ 52.648595] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 >>>> max_policy_perf:17 >>>> [ 52.648598] intel_pstate: cpu:0 global_min:8 global_max:30 >>>> [ 52.648602] intel_pstate: cpu:0 max_perf_ratio:17 >>>> min_perf_ratio:8 >>>> [ 52.656093] CPU 0: _PPC is 6 - frequency limited >>>> [ 52.656111] intel_pstate: set_policy cpuinfo.max 3000000 >>>> policy- >>>>> max 1700000 >>>> >>>> [ 52.656116] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 >>>> max_policy_perf:17 >>>> [ 52.656120] intel_pstate: cpu:0 global_min:8 global_max:30 >>>> [ 52.656123] intel_pstate: cpu:0 max_perf_ratio:17 >>>> min_perf_ratio:8 >>>> [ 52.775577] CPU 0: _PPC is 6 - frequency limited >>>> [ 52.775594] intel_pstate: set_policy cpuinfo.max 3000000 >>>> policy- >>>>> max 1700000 >>>> >>>> [ 52.775598] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 >>>> max_policy_perf:17 >>>> [ 52.775601] intel_pstate: cpu:0 global_min:8 global_max:30 >>>> [ 52.775604] intel_pstate: cpu:0 max_perf_ratio:17 >>>> min_perf_ratio:8 >>>> [ 53.028620] CPU 0: _PPC is 6 - frequency limited >>>> [ 53.028637] intel_pstate: set_policy cpuinfo.max 3000000 >>>> policy- >>>>> max 1700000 >>>> >>>> [ 53.028643] intel_pstate: cpu:0 max_state 17 min_policy_perf:8 >>>> max_policy_perf:17 >>>> [ 53.028647] intel_pstate: cpu:0 global_min:8 global_max:30 >>>> [ 53.028651] intel_pstate: cpu:0 max_perf_ratio:17 >>>> min_perf_ratio:8 >>>> >>>>> and send dmesg after you change power sources. >>>>> >>>>> - Also try with >>>>> intel_pstate=disable dyndbg="file processor_perflib.c +p" >>>> >>>> Nothing gets printed with this one. >>>> >>>> Thanks, >>>> Gabriele >>>> >>>>> and send dmesg. >>>>> >>>>> Thanks, >>>>> Srinivas >>>>> >>>>> ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-08-07 22:05 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-08-04 15:29 [PATCH] Revert "cpufreq: intel_pstate: Fix ->set_policy() interface for no_turbo" Gabriele Mazzotta 2018-08-04 17:31 ` Gabriele Mazzotta 2018-08-06 8:30 ` Rafael J. Wysocki 2018-08-06 16:49 ` Srinivas Pandruvada 2018-08-06 21:50 ` Gabriele Mazzotta 2018-08-06 22:11 ` Srinivas Pandruvada 2018-08-07 20:12 ` Gabriele Mazzotta 2018-08-07 21:22 ` Srinivas Pandruvada 2018-08-07 22:05 ` Gabriele Mazzotta
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).