Re: [PATCH V2 3/4] intel_pstate: Ignore scheduler cpufreq callbacks on remote CPUs
From: Srinivas Pandruvada
Date: Thu Jun 29 2017 - 17:24:11 EST
On Thu, 2017-06-29 at 10:56 +0530, Viresh Kumar wrote:
> From: Steve Muckle <smuckle.linux@xxxxxxxxx>
>
> In preparation for the scheduler cpufreq callback happening on remote
> CPUs, check for this case in intel_pstate which currently requires
> the
> callback run on the local CPU. Such callbacks are ignored for now.
Is it possible that we miss a chance to calculate load periodically at
a predefined interval (10ms default), because the callback happened on
a different CPU?
Thanks,
Srinivas
>
> Signed-off-by: Steve Muckle <smuckle.linux@xxxxxxxxx>
> Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
> ---
> Âdrivers/cpufreq/intel_pstate.c | 3 +++
> Â1 file changed, 3 insertions(+)
>
> diff --git a/drivers/cpufreq/intel_pstate.c
> b/drivers/cpufreq/intel_pstate.c
> index 4ce501148790..7a2a8ee579ef 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -1755,6 +1755,9 @@ static void intel_pstate_update_util(struct
> update_util_data *data, u64 time,
> Â struct cpudata *cpu = container_of(data, struct cpudata,
> update_util);
> Â u64 delta_ns;
> Â
> + if (smp_processor_id() != data->cpu)
> + return;
> +
> Â if (flags & SCHED_CPUFREQ_IOWAIT) {
> Â cpu->iowait_boost = int_tofp(1);
> Â } else if (cpu->iowait_boost) {