Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1370321

Re: [PATCH] cpufreq: intel_pstate: fix inconsistency in setting policy limits

Path csiph.com!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod
From "Rafael J. Wysocki" <rafael@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] cpufreq: intel_pstate: fix inconsistency in setting policy limits
Date Mon, 04 Apr 2016 03:20:02 +0200
Message-ID <rk1lo-3FN-5@gated-at.bofh.it> (permalink)
References <rjWvn-f8-3@gated-at.bofh.it>
X-Original-To Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=5J3TxbapOiDGg3yWReg4mveo3hmk1L4/w6WU7/zrhFg=; b=JjXAeaRKf+lvHlqFoS/QJgOdSNl9Urpm5fsCbAgerJApYFCz96HnDnlfxxm4OqjdiZ P10bRBpD3STmvmFGIf54T4WhlEQdfcg0Nrcs8/9DZ4T8jCf2MdqbOfGDyByp9Oe/UZ8L N9e8X5h1/igmRWBwP+/9A+zsNm/qC0Gl+1iFyE0O8EOKQkcpafmYo1Zp8ANjCTqWZKQ0 NaaBG3sAP5PE5PoG/wFqcuvDdDsC3pqs27rIyxGOY8wRA2//acCF7o4ogScUtJJoIu7o O8brHd2myAi4ASZTY0bCpjY7C8ckAUiKYPUEBHsPu6373sFeIK9ExQHG1BHPxIbuwDz/ UY/Q==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=5J3TxbapOiDGg3yWReg4mveo3hmk1L4/w6WU7/zrhFg=; b=LWyLgUYs0wFCBQSIc4MvAFIJghUmYbnInQeLjgENACuMZaSm2JAPyskavBAOZxTXSD /WbMXOds1kq+wWdPzHCHZNjDDG1dNqxBU/GbuY0l4Ws4QRfAacuDR0gSFvRnbxpmIbgJ QvYdfWT3I8/kgJTU1j0fUu6ctmz8FMqjJRPlGhu6+174mXzQx1zn7P44cCjFUeGII8Ig 3DCnclNIT8TdCu5T9xTyhW6+LxHdErchZ4sXfRPZ3WVXgmv1URx5LUzLOqrM/kfr1ODW ecDe9ES0Vkzii3HOC3mX/9TjSMNZRM8WX8n7z3spvv7FqAOfmW5wAPKzo2qO6P4yzg90 /bOw==
X-Gm-Message-State AD7BkJJZo32rTmF2xZBy+gNYHuLCyLc1If1DO3iqmx8oTXrICLgcFlRRxLujEtGJipe92Q81plH6BDQr7i4pRg==
MIME-Version 1.0
X-Received by 10.25.78.80 with SMTP id c77mr1611115lfb.62.1459732569400; Sun, 03 Apr 2016 18:16:09 -0700 (PDT)
X-Google-Sender-Auth juTNL4kgLSR_wbqfHVwRMSgYRso
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 58
Organization linux.* mail to news gateway
X-Original-Cc "Rafael J. Wysocki" <rjw@rjwysocki.net>, "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
X-Original-Date Mon, 4 Apr 2016 03:16:09 +0200
X-Original-Message-ID <CAJZ5v0iA7r6yP-dViiXjOuKuvED2eNWZdVACe=ByrzLR47QEMQ@mail.gmail.com>
X-Original-References <1459713972-5654-1-git-send-email-srinivas.pandruvada@linux.intel.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1370321

Show key headers only | View raw


On Sun, Apr 3, 2016 at 10:06 PM, Srinivas Pandruvada
<srinivas.pandruvada@linux.intel.com> wrote:
> When user sets performance policy using cpufreq interface, it is possible
> that because of policy->max limits, the actual performance is still
> limited. But the current implementation will silently switch the
> policy to powersave and start using powersave limits. If user modifies
> any limits using intel_pstate sysfs, this is actually changing powersave
> limits.
>
> The current implementation tracks limits under powersave and performance
> policy using two different variables. When policy->max is less than
> policy->cpuinfo.max_freq, only powersave limit variable is used.
>
> This fix involves uses performance limits variable always when policy
> is performance.
>
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> ---
>  drivers/cpufreq/intel_pstate.c | 40 ++++++++++++++++++++++++++++++++--------
>  1 file changed, 32 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> index 4b64452..776cea7 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -1122,22 +1122,46 @@ static unsigned int intel_pstate_get(unsigned int cpu_num)
>         return get_avg_frequency(cpu);
>  }
>
> +static void intel_pstate_set_performance_limits(struct perf_limits *limits)
> +{
> +       limits->no_turbo = 0;
> +       limits->turbo_disabled = 0;
> +       limits->max_perf_pct = 100;
> +       limits->max_perf = int_tofp(1);
> +       limits->min_perf_pct = 100;
> +       limits->min_perf = int_tofp(1);
> +       limits->max_policy_pct = 100;
> +       limits->max_sysfs_pct = 100;
> +       limits->min_policy_pct = 0;
> +       limits->min_sysfs_pct = 0;
> +}
> +
>  static int intel_pstate_set_policy(struct cpufreq_policy *policy)
>  {
>         if (!policy->cpuinfo.max_freq)
>                 return -ENODEV;
>
> -       if (policy->policy == CPUFREQ_POLICY_PERFORMANCE &&
> -           policy->max >= policy->cpuinfo.max_freq) {
> -               pr_debug("intel_pstate: set performance\n");
> +       if (policy->policy == CPUFREQ_POLICY_PERFORMANCE) {
>                 limits = &performance_limits;
> -               if (hwp_active)
> -                       intel_pstate_hwp_set(policy->cpus);

Can you please rebase this on top of my linux-next branch?  This
change in particular will conflict with one commit already in there.

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH] cpufreq: intel_pstate: fix inconsistency in setting policy limits Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> - 2016-04-03 22:10 +0200
  Re: [PATCH] cpufreq: intel_pstate: fix inconsistency in setting  policy limits "Rafael J. Wysocki" <rafael@kernel.org> - 2016-04-04 03:20 +0200

csiph-web