* [dpdk-dev] [PATCH] power: handle frequency increase with turbo disabled
@ 2019-11-14 14:10 Mattias Rönnblom
2019-11-14 16:23 ` Hunt, David
2019-11-15 12:23 ` Liang, Ma
0 siblings, 2 replies; 4+ messages in thread
From: Mattias Rönnblom @ 2019-11-14 14:10 UTC (permalink / raw)
To: david.hunt; +Cc: dev, alan.carew, liang.j.ma, Mattias Rönnblom, stable
Calling pstate's or acpi's rte_power_freq_up() when on the highest
non-turbo frequency results in an error, if turbo is disabled. The
error is in the form of a return code and a RTE_LOG() entry on the ERR
level.
According to the API documentation, the frequency is scaled up
"according to the available frequencies". In case turbo is disabled,
that frequency is not available. This patch's rte_power_freq_up()
behaviour is also consistent with how rte_power_freq_max() is
implemented (i.e. the highest non-turbo frequency is set, in case
turbo is disabled).
Fixes: 445c6528b55f ("power: common interface for guest and host")
Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility")
Cc: stable@dpdk.org
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
---
lib/librte_power/power_acpi_cpufreq.c | 3 ++-
lib/librte_power/power_pstate_cpufreq.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/librte_power/power_acpi_cpufreq.c b/lib/librte_power/power_acpi_cpufreq.c
index 7c386f891..6ea9c640e 100644
--- a/lib/librte_power/power_acpi_cpufreq.c
+++ b/lib/librte_power/power_acpi_cpufreq.c
@@ -515,7 +515,8 @@ power_acpi_cpufreq_freq_up(unsigned int lcore_id)
}
pi = &lcore_power_info[lcore_id];
- if (pi->curr_idx == 0)
+ if (pi->curr_idx == 0 ||
+ (pi->curr_idx == 1 && pi->turbo_available && !pi->turbo_enable))
return 0;
/* Frequencies in the array are from high to low. */
diff --git a/lib/librte_power/power_pstate_cpufreq.c b/lib/librte_power/power_pstate_cpufreq.c
index ecbcb3ac9..7bdc595cf 100644
--- a/lib/librte_power/power_pstate_cpufreq.c
+++ b/lib/librte_power/power_pstate_cpufreq.c
@@ -696,7 +696,8 @@ power_pstate_cpufreq_freq_up(unsigned int lcore_id)
}
pi = &lcore_power_info[lcore_id];
- if (pi->curr_idx == 0)
+ if (pi->curr_idx == 0 ||
+ (pi->curr_idx == 1 && pi->turbo_available && !pi->turbo_enable))
return 0;
/* Frequencies in the array are from high to low. */
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] power: handle frequency increase with turbo disabled
2019-11-14 14:10 [dpdk-dev] [PATCH] power: handle frequency increase with turbo disabled Mattias Rönnblom
@ 2019-11-14 16:23 ` Hunt, David
2019-11-20 23:53 ` Thomas Monjalon
2019-11-15 12:23 ` Liang, Ma
1 sibling, 1 reply; 4+ messages in thread
From: Hunt, David @ 2019-11-14 16:23 UTC (permalink / raw)
To: Mattias Rönnblom; +Cc: dev, alan.carew, liang.j.ma, stable
Hi Mattias,
On 14/11/2019 14:10, Mattias Rönnblom wrote:
> Calling pstate's or acpi's rte_power_freq_up() when on the highest
> non-turbo frequency results in an error, if turbo is disabled. The
> error is in the form of a return code and a RTE_LOG() entry on the ERR
> level.
>
> According to the API documentation, the frequency is scaled up
> "according to the available frequencies". In case turbo is disabled,
> that frequency is not available. This patch's rte_power_freq_up()
> behaviour is also consistent with how rte_power_freq_max() is
> implemented (i.e. the highest non-turbo frequency is set, in case
> turbo is disabled).
>
> Fixes: 445c6528b55f ("power: common interface for guest and host")
> Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility")
> Cc: stable@dpdk.org
>
> Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
> ---
Thanks for the patch, I can repeat the issue without the patch, and
after applying the patch, I no longer get the error message. So:
Tested-by: David Hunt <david.hunt@intel.com>
It might be worth clarifying in the commit message that "turbo
disabled"actually means "turbo enabled in the bios, but disabled via the
power library", but that's a small point.
Acked-By: David Hunt <david.hunt@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] power: handle frequency increase with turbo disabled
2019-11-14 16:23 ` Hunt, David
@ 2019-11-20 23:53 ` Thomas Monjalon
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2019-11-20 23:53 UTC (permalink / raw)
To: Mattias Rönnblom; +Cc: dev, Hunt, David, alan.carew, liang.j.ma, stable
14/11/2019 17:23, Hunt, David:
> Hi Mattias,
>
> On 14/11/2019 14:10, Mattias Rönnblom wrote:
> > Calling pstate's or acpi's rte_power_freq_up() when on the highest
> > non-turbo frequency results in an error, if turbo is disabled. The
> > error is in the form of a return code and a RTE_LOG() entry on the ERR
> > level.
> >
> > According to the API documentation, the frequency is scaled up
> > "according to the available frequencies". In case turbo is disabled,
> > that frequency is not available. This patch's rte_power_freq_up()
> > behaviour is also consistent with how rte_power_freq_max() is
> > implemented (i.e. the highest non-turbo frequency is set, in case
> > turbo is disabled).
> >
> > Fixes: 445c6528b55f ("power: common interface for guest and host")
> > Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
> > ---
>
> Thanks for the patch, I can repeat the issue without the patch, and
> after applying the patch, I no longer get the error message. So:
>
> Tested-by: David Hunt <david.hunt@intel.com>
>
> It might be worth clarifying in the commit message that "turbo
> disabled"actually means "turbo enabled in the bios, but disabled via the
> power library", but that's a small point.
>
> Acked-By: David Hunt <david.hunt@intel.com>
Applied with change in commit log, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] power: handle frequency increase with turbo disabled
2019-11-14 14:10 [dpdk-dev] [PATCH] power: handle frequency increase with turbo disabled Mattias Rönnblom
2019-11-14 16:23 ` Hunt, David
@ 2019-11-15 12:23 ` Liang, Ma
1 sibling, 0 replies; 4+ messages in thread
From: Liang, Ma @ 2019-11-15 12:23 UTC (permalink / raw)
To: Mattias Rönnblom; +Cc: david.hunt, dev, alan.carew, stable
Hi Mattias,
On 14 Nov 15:10, Mattias Rönnblom wrote:
> Calling pstate's or acpi's rte_power_freq_up() when on the highest
> non-turbo frequency results in an error, if turbo is disabled. The
> error is in the form of a return code and a RTE_LOG() entry on the ERR
> level.
>
> According to the API documentation, the frequency is scaled up
> "according to the available frequencies". In case turbo is disabled,
> that frequency is not available. This patch's rte_power_freq_up()
> behaviour is also consistent with how rte_power_freq_max() is
> implemented (i.e. the highest non-turbo frequency is set, in case
> turbo is disabled).
>
> Fixes: 445c6528b55f ("power: common interface for guest and host")
> Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility")
> Cc: stable@dpdk.org
>
> Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
> ---
Thanks for your patches. I reviewed it and I'm OK with that changes.
Reviewed-by: Liang Ma <liang.j.ma@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-11-20 23:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-14 14:10 [dpdk-dev] [PATCH] power: handle frequency increase with turbo disabled Mattias Rönnblom
2019-11-14 16:23 ` Hunt, David
2019-11-20 23:53 ` Thomas Monjalon
2019-11-15 12:23 ` Liang, Ma
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).