Re: [RFC/RFT] [PATCH 07/10] cpufreq: intel_pstate: HWP boost performance on busy task migrate

From: Rafael J. Wysocki
Date: Wed May 16 2018 - 05:17:01 EST


On Wed, May 16, 2018 at 6:49 AM, Srinivas Pandruvada
<srinivas.pandruvada@xxxxxxxxxxxxxxx> wrote:
> When a busy task migrates to a new CPU boost HWP prformance to max. This
> helps workloads on servers with per core P-states, which saturates all
> CPUs and then they migrate frequently. But changing limits has extra over
> head of issuing new HWP Request MSR, which takes 1000+
> cycles. So this change limits setting HWP Request MSR.
> Rate control in setting HWP Requests:
> - If the current performance is around P1, simply ignore.
> - Once set wait till hold time, till remove boost. While the boost
> is on, another flags is notified, it will prolong boost.
> - The task migrates needs to have some utilzation which is more
> than threshold utilization, which will trigger P-state above minimum.
>
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@xxxxxxxxxxxxxxx>
> ---
> drivers/cpufreq/intel_pstate.c | 37 ++++++++++++++++++++++++++++++++++++-
> 1 file changed, 36 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> index d418265..ec455af 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -227,6 +227,7 @@ struct global_params {
> * defines callback and arguments
> * @hwp_boost_active: HWP performance is boosted on this CPU
> * @last_io_update: Last time when IO wake flag was set
> + * @migrate_hint: Set when scheduler indicates thread migration
> *
> * This structure stores per CPU instance data for all CPUs.
> */
> @@ -263,6 +264,7 @@ struct cpudata {
> call_single_data_t csd;
> bool hwp_boost_active;
> u64 last_io_update;
> + bool migrate_hint;

Why do you need this in the struct?

It looks like it only is used locally in intel_pstate_update_util_hwp().

> };