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


Groups > linux.kernel > #1589841

Re: [PATCH 1/2] cpufreq: intel_pstate: Fix global settings in active mode

From "Rafael J. Wysocki" <rafael@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] cpufreq: intel_pstate: Fix global settings in active mode
Date 2017-02-28 23:40 +0100
Message-ID <tfYB4-28l-7@gated-at.bofh.it> (permalink)
References <tfQ0N-4XF-5@gated-at.bofh.it> <tfQ0O-4XF-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Feb 28, 2017 at 2:14 PM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Commit 111b8b3fe4fa (cpufreq: intel_pstate: Always keep all
> limits settings in sync) changed intel_pstate to invoke
> cpufreq_update_policy() for every registered CPU on global sysfs
> attributes updates, but that led to undesirable effects in the
> active mode if the "performance" P-state selection algorithm is
> configufred for one CPU and the "powersave" one is chosen for
> all of the other CPUs.
>
> Namely, in that case, the following is possible:
>
>  # cd /sys/devices/system/cpu/
>  # cat intel_pstate/max_perf_pct
>  100
>  # cat intel_pstate/min_perf_pct
>  26
>  # echo performance > cpufreq/policy0/scaling_governor
>  # cat intel_pstate/max_perf_pct
>  100
>  # cat intel_pstate/min_perf_pct
>  100
>  # echo 94 > intel_pstate/min_perf_pct
>  # cat intel_pstate/min_perf_pct
>  26
>
> The reason why this happens is because intel_pstate attempts to
> maintain two sets of global limits in the active mode, one for
> the "performance" P-state selection algorithm and one for the
> "powersave"  P-state selection algorithm, but the P-state selection
> algorithms are set per policy, so the global limits cannot reflect
> all of them at the same time if they are different for different
> policies.
>
> In the particular situation above, the attempt to change
> min_perf_pct to 94 caused cpufreq_update_policy() to be run
> for a CPU with the "powersave"  P-state selection algorithm
> and intel_pstate_set_policy() called by it silently switched the
> global limits to the "powersave" set which finally was reflected
> by the sysfs interface.
>
> To prevent that from happening, modify intel_pstate_update_policies()
> to always switch back to the set of limits that was used right before
> it has been invoked.

Scratch this, it's too racy.

I'll send a new version shortly.

Thanks,
Rafael

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


Thread

[PATCH 0/2] cpufreq: intel_pstate: Two fixes related to limis "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-02-28 14:30 +0100
  [PATCH 1/2] cpufreq: intel_pstate: Fix global settings in active mode "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-02-28 14:30 +0100
    Re: [PATCH 1/2] cpufreq: intel_pstate: Fix global settings in active mode "Rafael J. Wysocki" <rafael@kernel.org> - 2017-02-28 23:40 +0100
  [PATCH 2/2] cpufreq: intel_pstate: Do not reinit performance limits in ->setpolicy "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-02-28 14:40 +0100
  [PATCH v2 3/3] cpufreq: intel_pstate: Fix intel_pstate_verify_policy() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-03-01 00:30 +0100
  [PATCH v2 1/3] cpufreq: intel_pstate: Fix global settings in active mode "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-03-01 00:30 +0100
  [PATCH v2 2/3] cpufreq: intel_pstate: Do not reinit performance limits in ->setpolicy "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-03-01 00:30 +0100
    Re: [PATCH v2 2/3] cpufreq: intel_pstate: Do not reinit performance  limits in ->setpolicy "Rafael J. Wysocki" <rafael@kernel.org> - 2017-03-02 18:30 +0100
      Re: [PATCH v2 2/3] cpufreq: intel_pstate: Do not reinit performance  limits in ->setpolicy "Rafael J. Wysocki" <rafael@kernel.org> - 2017-03-02 18:30 +0100
    [Update][PATCH v3 2/3] cpufreq: intel_pstate: Do not reinit performance limits in ->setpolicy "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-03-02 23:40 +0100
  [PATCH v2 0/3] cpufreq: intel_pstate: Fixes related to limis "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-03-01 00:30 +0100

csiph-web