All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Linux PM list <linux-pm@vger.kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] intel_pstate: Update cpu_frequency tracepoint every time
Date: Tue, 19 Jul 2016 15:39:18 -0700	[thread overview]
Message-ID: <1468967958.2125.2.camel@linux.intel.com> (raw)
In-Reply-To: <3678564.0E838ntcHL@vostro.rjw.lan>

On Tue, 2016-07-19 at 15:10 +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Currently, intel_pstate only updates the cpu_frequency tracepoint
> if the new P-state to set is different from the current one, but
> that causes powertop to report 100% idle on an 100% loaded system
> sometimes.
> 
> Prevent that from happening by updating the cpu_frequency tracepoint
> every time intel_pstate_update_pstate() is called.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>-

> --
>  drivers/cpufreq/intel_pstate.c |   12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> Index: linux-pm/drivers/cpufreq/intel_pstate.c
> ===================================================================
> --- linux-pm.orig/drivers/cpufreq/intel_pstate.c
> +++ linux-pm/drivers/cpufreq/intel_pstate.c
> @@ -1134,17 +1134,12 @@ static void intel_pstate_get_min_max(str
>  	*min = clamp_t(int, min_perf, cpu->pstate.min_pstate,
> max_perf);
>  }
>  
> -static inline void intel_pstate_record_pstate(struct cpudata *cpu,
> int pstate)
> -{
> -	trace_cpu_frequency(pstate * cpu->pstate.scaling, cpu->cpu);
> -	cpu->pstate.current_pstate = pstate;
> -}
> -
>  static void intel_pstate_set_min_pstate(struct cpudata *cpu)
>  {
>  	int pstate = cpu->pstate.min_pstate;
>  
> -	intel_pstate_record_pstate(cpu, pstate);
> +	trace_cpu_frequency(pstate * cpu->pstate.scaling, cpu->cpu);
> +	cpu->pstate.current_pstate = pstate;
>  	/*
>  	 * Generally, there is no guarantee that this code will
> always run on
>  	 * the CPU being updated, so force the register update to
> run on the
> @@ -1304,10 +1299,11 @@ static inline void intel_pstate_update_p
>  
>  	intel_pstate_get_min_max(cpu, &min_perf, &max_perf);
>  	pstate = clamp_t(int, pstate, min_perf, max_perf);
> +	trace_cpu_frequency(pstate * cpu->pstate.scaling, cpu->cpu);
>  	if (pstate == cpu->pstate.current_pstate)
>  		return;
>  
> -	intel_pstate_record_pstate(cpu, pstate);
> +	cpu->pstate.current_pstate = pstate;
>  	wrmsrl(MSR_IA32_PERF_CTL, pstate_funcs.get_val(cpu,
> pstate));
>  }
>  
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-07-19 22:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-19 13:10 [PATCH] intel_pstate: Update cpu_frequency tracepoint every time Rafael J. Wysocki
2016-07-19 22:39 ` Srinivas Pandruvada [this message]
2016-07-20  3:14   ` Doug Smythies
2016-07-23 12:41     ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1468967958.2125.2.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.