1. 01 3月, 2023 1 次提交
  2. 24 2月, 2023 1 次提交
    • S
      cpufreq: intel_pstate: Adjust balance_performance EPP for Sapphire Rapids · 60675225
      Srinivas Pandruvada 提交于
      While the majority of server OS distributions are deployed with the
      "performance" governor as the default, some distributions like Ubuntu use
      the "powersave" governor by default.
      
      While using the "powersave" governor in its default configuration on
      Sapphire Rapids systems leads to much lower power, the performance is
      lower by more than 25% for several workloads relative to the
      "performance" governor.
      
      A 37% difference has been reported by www.Phoronix.com [1].
      
      This is a consequence of using a relatively high EPP value in the
      default configuration of the "powersave" governor and the performance
      can be made much closer to the "performance" governor's level by
      adjusting the default EPP value. Based on experiments, with EPP of 0x00,
      0x10, 0x20, the performance delta between the "powersave" governor and
      the "performance" one is around 12%. However, the EPP of 0x20 reduces
      average power by 18% with respect to the lower EPP values.
      
      [Note that raising min_perf_pct in sysfs as high as 50% in addition to
       adjusting EPP does not improve the performance any further.]
      
      For this reason, change the EPP value corresponding to the the default
      balance_performance setting for Sapphire Rapids to 0x20, which is
      straightforward, because analogous default EPP adjustment has been
      applied to Alder Lake and there is a way to set the balance_performance
      EPP value in intel_pstate based on the processor model already.
      
      The goal here is to limit the mean performance delta between the
      "powersave" governor in the default configuration and the "performance"
      governor for a wide variety of server workloadsto to around 10-12%. For
      some bursty workloads, this delta can be still large, as the frequency
      ramp-up will still lag when the "powersave" governor is in use
      irrespective of the EPP setting, because the performance governor always
      requests the maximum possible frequency.
      
      Link: https://www.phoronix.com/review/centos-clear-spr/6 # [1]
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      [ rjw: Subject and changelog edits ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      60675225
  3. 31 12月, 2022 1 次提交
  4. 01 12月, 2022 1 次提交
  5. 04 11月, 2022 1 次提交
    • S
      cpufreq: intel_pstate: Allow EPP 0x80 setting by the firmware · 21cdb6c1
      Srinivas Pandruvada 提交于
      With the
      "commit 3d13058e ("cpufreq: intel_pstate: Use firmware default EPP")"
      the firmware can set an EPP, which driver will not overwrite. But the
      driver has a valid range check for:
      0x40 > firmware epp < 0x80.
      Hence firmware can't specify EPP of 0x80.
      
      If the firmware didn't specify in the valid range, the driver has a
      hard coded EPP of 102. But some Chrome hardware vendors don't want
      this overwrite and wants to boot with chipset default EPP of 0x80 as
      this improves battery life.
      
      In this case they want to have capability to specify EPP of 0x80 via
      the firmware. This require the valid range to include 0x80 also.
      But here the valid range can't be simply extended to include 0x80 as
      this is the chipset default EPP. Even without any firmware specifying
      EPP, the chipset will always boot with EPP of 0x80.
      
      To make sure that firmware specified EPP of 0x80 and not by the
      chipset default, it will require additional check to make sure HWP
      was enabled by the firmware before boot. Only way the firmware can
      update EPP, is to enable HWP and update EPP via MSR_HWP_REQUEST.
      
      This driver already checks, if the HWP is enabled by the firmware.
      Use the same flag and extend valid range to include 0x80.
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      21cdb6c1
  6. 25 10月, 2022 2 次提交
    • R
      cpufreq: intel_pstate: hybrid: Use known scaling factor for P-cores · f5c8cf2a
      Rafael J. Wysocki 提交于
      Commit 46573fd6 ("cpufreq: intel_pstate: hybrid: Rework HWP
      calibration") attempted to use the information from CPPC (the nominal
      performance in particular) to obtain the scaling factor allowing the
      frequency to be computed if the HWP performance level of the given CPU
      is known or vice versa.
      
      However, it turns out that on some platforms this doesn't work, because
      the CPPC information on them does not align with the contents of the
      MSR_HWP_CAPABILITIES registers.
      
      This basically means that the only way to make intel_pstate work on all
      of the hybrid platforms to date is to use the observation that on all
      of them the scaling factor between the HWP performance levels and
      frequency for P-cores is 78741 (approximately 100000/1.27).  For
      E-cores it is 100000, which is the same as for all of the non-hybrid
      "core" platforms and does not require any changes.
      
      Accordingly, make intel_pstate use 78741 as the scaling factor between
      HWP performance levels and frequency for P-cores on all hybrid platforms
      and drop the dependency of the HWP calibration code on CPPC.
      
      Fixes: 46573fd6 ("cpufreq: intel_pstate: hybrid: Rework HWP calibration")
      Reported-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Acked-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Tested-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Cc: 5.15+ <stable@vger.kernel.org> # 5.15+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f5c8cf2a
    • R
      cpufreq: intel_pstate: Read all MSRs on the target CPU · 8dbab94d
      Rafael J. Wysocki 提交于
      Some of the MSR accesses in intel_pstate are carried out on the CPU
      that is running the code, but the values coming from them are used
      for the performance scaling of the other CPUs.
      
      This is problematic, for example, on hybrid platforms where
      MSR_TURBO_RATIO_LIMIT for P-cores and E-cores is different, so the
      values read from it on a P-core are generally not applicable to E-cores
      and the other way around.
      
      For this reason, make the driver access all MSRs on the target CPU on
      platforms using the "core" pstate_funcs callbacks which is the case for
      all of the hybrid platforms released to date.  For this purpose, pass
      a CPU argument to the ->get_max(), ->get_max_physical(), ->get_min()
      and ->get_turbo() pstate_funcs callbacks and from there pass it to
      rdmsrl_on_cpu() or rdmsrl_safe_on_cpu() to access the MSR on the target
      CPU.
      
      Fixes: 46573fd6 ("cpufreq: intel_pstate: hybrid: Rework HWP calibration")
      Acked-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Tested-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Cc: 5.15+ <stable@vger.kernel.org> # 5.15+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8dbab94d
  7. 11 9月, 2022 1 次提交
  8. 12 5月, 2022 1 次提交
  9. 13 4月, 2022 1 次提交
    • C
      cpufreq: intel_pstate: Handle no_turbo in frequency invariance · addca285
      Chen Yu 提交于
      Problem statement:
      
      Once the user has disabled turbo frequency by
      
      # echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
      
      the cfs_rq's util_avg becomes quite small when compared with
      CPU capacity.
      
      Step to reproduce:
      
      # echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
      
      # ./x86_cpuload --count 1 --start 3 --timeout 100 --busy 99
      
      would launch 1 thread and bind it to CPU3, lasting for 100 seconds,
      with a CPU utilization of 99%. [1]
      
      top result:
      %Cpu3  : 98.4 us,  0.0 sy,  0.0 ni,  1.6 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
      
      check util_avg:
      cat /sys/kernel/debug/sched/debug | grep "cfs_rq\[3\]" -A 20 | grep util_avg
        .util_avg                      : 611
      
      So the util_avg/cpu capacity is 611/1024, which is much smaller than
      98.4% shown in the top result.
      
      This might impact some logic in the scheduler. For example,
      group_is_overloaded() would compare the group_capacity and group_util
      in the sched group, to check if this sched group is overloaded or not.
      With this gap, even when there is a nearly 100% workload, the sched
      group will not be regarded as overloaded. Besides group_is_overloaded(),
      there are also other victims. There is a ongoing work that aims to
      optimize the task wakeup in a LLC domain. The main idea is to stop
      searching idle CPUs if the sched domain is overloaded[2]. This proposal
      also relies on the util_avg/CPU capacity to decide whether the LLC
      domain is overloaded.
      
      Analysis:
      
      CPU frequency invariance has caused this difference. In summary,
      the util_sum of cfs rq would decay quite fast when the CPU is in
      idle, when the CPU frequency invariance is enabled.
      
      The detail is as followed:
      
      As depicted in update_rq_clock_pelt(), when the frequency invariance
      is enabled, there would be two clock variables on each rq, clock_task
      and clock_pelt:
      
         The clock_pelt scales the time to reflect the effective amount of
         computation done during the running delta time but then syncs back to
         clock_task when rq is idle.
      
         absolute time    | 1| 2| 3| 4| 5| 6| 7| 8| 9|10|11|12|13|14|15|16
         @ max frequency  ------******---------------******---------------
         @ half frequency ------************---------************---------
         clock pelt       | 1| 2|    3|    4| 7| 8| 9|   10|   11|14|15|16
      
      The fast decay of util_sum during idle is due to:
      
       1. rq->clock_pelt is always behind rq->clock_task
       2. rq->last_update is updated to rq->clock_pelt' after invoking
          ___update_load_sum()
       3. Then the CPU becomes idle, the rq->clock_pelt' would be suddenly
          increased a lot to rq->clock_task
       4. Enters ___update_load_sum() again, the idle period is calculated by
          rq->clock_task - rq->last_update, AKA, rq->clock_task - rq->clock_pelt'.
          The lower the CPU frequency is, the larger the delta =
          rq->clock_task - rq->clock_pelt' will be. Since the idle period will be
          used to decay the util_sum only, the util_sum drops significantly during
          idle period.
      
      Proposal:
      
      This symptom is not only caused by disabling turbo frequency, but it
      would also appear if the user limits the max frequency at runtime.
      
      Because, if the frequency is always lower than the max frequency,
      CPU frequency invariance would decay the util_sum quite fast during
      idle.
      
      As some end users would disable turbo after boot up, this patch aims to
      present this symptom and deals with turbo scenarios for now.
      
      It might be ideal if CPU frequency invariance is aware of the max CPU
      frequency (user specified) at runtime in the future.
      
      Link: https://github.com/yu-chen-surf/x86_cpuload.git #1
      Link: https://lore.kernel.org/lkml/20220310005228.11737-1-yu.c.chen@intel.com/ #2
      Signed-off-by: NChen Yu <yu.c.chen@intel.com>
      Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Reviewed-by: NGiovanni Gherdovich <ggherdovich@suse.cz>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      addca285
  10. 17 3月, 2022 1 次提交
    • S
      cpufreq: intel_pstate: Use firmware default EPP · 3d13058e
      Srinivas Pandruvada 提交于
      For some specific platforms (E.g. AlderLake) the balance performance
      EPP is updated from the hard coded value in the driver. This acts as
      the default and balance_performance EPP. The purpose of this EPP
      update is to reach maximum 1 core turbo frequency (when possible) out
      of the box.
      
      Although we can achieve the objective by using hard coded value in the
      driver, there can be other EPP which can be better in terms of power.
      But that will be very subjective based on platform and use cases.
      This is not practical to have a per platform specific default hard coded
      in the driver.
      
      If a platform wants to specify default EPP, it can be set in the firmware.
      If this EPP is not the chipset default of 0x80 (balance_perf_epp unless
      driver changed it) and more performance oriented but not 0, the driver
      can use this as the default and balanced_perf EPP. In this case no driver
      update is required every time there is some new platform and default EPP.
      
      If the firmware didn't update the EPP from the chipset default then
      the hard coded value is used as per existing implementation.
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      3d13058e
  11. 23 12月, 2021 1 次提交
    • R
      cpufreq: intel_pstate: Update cpuinfo.max_freq on HWP_CAP changes · dfeeedc1
      Rafael J. Wysocki 提交于
      With HWP enabled, when the turbo range of performance levels is
      disabled by the platform firmware, the CPU capacity is given by
      the "guaranteed performance" field in MSR_HWP_CAPABILITIES which
      is generally dynamic.  When it changes, the kernel receives an HWP
      notification interrupt handled by notify_hwp_interrupt().
      
      When the "guaranteed performance" value changes in the above
      configuration, the CPU performance scaling needs to be adjusted so
      as to use the new CPU capacity in computations, which means that
      the cpuinfo.max_freq value needs to be updated for that CPU.
      
      Accordingly, modify intel_pstate_notify_work() to read
      MSR_HWP_CAPABILITIES and update cpuinfo.max_freq to reflect the
      new configuration (this update can be carried out even if the
      configuration doesn't actually change, because it simply doesn't
      matter then and it takes less time to update it than to do extra
      checks to decide whether or not a change has really occurred).
      Reported-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Tested-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      dfeeedc1
  12. 17 12月, 2021 2 次提交
    • S
      cpufreq: intel_pstate: Update EPP for AlderLake mobile · b6e6f8be
      Srinivas Pandruvada 提交于
      There is an expectation from users that they can get frequency specified
      by cpufreq/cpuinfo_max_freq when conditions permit. But with AlderLake
      mobile it may not be possible. This is possible that frequency is clipped
      based on the system power-up EPP value. In this case users can update
      cpufreq/energy_performance_preference to some performance oriented EPP to
      limit clipping of frequencies.
      
      To get out of box behavior as the prior generations of CPUs, update EPP
      for AlderLake mobile CPUs on boot. On prior generations of CPUs EPP = 128
      was enough to get maximum frequency, but with AlderLake mobile the
      equivalent EPP is 102. Since EPP is model specific, this is possible that
      they have different meaning on each generation of CPU.
      
      The current EPP string "balance_performance" corresponds to EPP = 128.
      Change the EPP corresponding to "balance_performance" to 102 for only
      AlderLake mobile CPUs and update this on each CPU during boot.
      
      To implement reuse epp_values[] array and update the modified EPP at the
      index for BALANCE_PERFORMANCE. Add a dummy EPP_INDEX_DEFAULT to
      epp_values[] to match indexes in the energy_perf_strings[].
      
      After HWP PM is enabled also update EPP when "balance_performance" is
      redefined for the very first time after the boot on each CPU. On
      subsequent suspend/resume or offline/online the old EPP is restored,
      so no specific action is needed.
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b6e6f8be
    • R
      cpufreq: intel_pstate: Drop redundant intel_pstate_get_hwp_cap() call · 458b03f8
      Rafael J. Wysocki 提交于
      It is not necessary to call intel_pstate_get_hwp_cap() from
      intel_pstate_update_perf_limits(), because it gets called from
      intel_pstate_verify_cpu_policy() which is either invoked directly
      right before intel_pstate_update_perf_limits(), in
      intel_cpufreq_verify_policy() in the passive mode, or called
      from driver callbacks in a sequence that causes it to be followed
      by an immediate intel_pstate_update_perf_limits().
      
      Namely, in the active mode intel_cpufreq_verify_policy() is called
      by intel_pstate_verify_policy() which is the ->verify() callback
      routine of intel_pstate and gets called by the cpufreq core right
      before intel_pstate_set_policy(), which is the driver's ->setoplicy()
      callback routine, where intel_pstate_update_perf_limits() is called.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      458b03f8
  13. 23 11月, 2021 3 次提交
  14. 05 11月, 2021 3 次提交
  15. 26 10月, 2021 1 次提交
  16. 05 10月, 2021 1 次提交
    • S
      cpufreq: intel_pstate: Process HWP Guaranteed change notification · 57577c99
      Srinivas Pandruvada 提交于
      It is possible that HWP guaranteed ratio is changed in response to
      change in power and thermal limits. For example when Intel Speed Select
      performance profile is changed or there is change in TDP, hardware can
      send notifications. It is possible that the guaranteed ratio is
      increased. This creates an issue when turbo is disabled, as the old
      limits set in MSR_HWP_REQUEST are still lower and hardware will clip
      to older limits.
      
      This change enables HWP interrupt and process HWP interrupts. When
      guaranteed is changed, calls cpufreq_update_policy() so that driver
      callbacks are called to update to new HWP limits. This callback
      is called from a delayed workqueue of 10ms to avoid frequent updates.
      
      Although the scope of IA32_HWP_INTERRUPT is per logical cpu, on some
      plaforms interrupt is generated on all CPUs. This is particularly a
      problem during initialization, when the driver didn't allocated
      data for other CPUs. So this change uses a cpumask of enabled CPUs and
      process interrupts on those CPUs only.
      
      When the cpufreq offline() or suspend() callback is called, HWP interrupt
      is disabled on those CPUs and also cancels any pending work item.
      
      Spin lock is used to protect data and processing shared with interrupt
      handler. Here READ_ONCE(), WRITE_ONCE() macros are used to designate
      shared data, even though spin lock act as an optimization barrier here.
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Tested-by: pablomh@gmail.com
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      57577c99
  17. 14 9月, 2021 1 次提交
  18. 08 9月, 2021 1 次提交
    • R
      cpufreq: intel_pstate: hybrid: Rework HWP calibration · 46573fd6
      Rafael J. Wysocki 提交于
      The current HWP calibration for hybrid processors in intel_pstate is
      fragile, because it depends too much on the information provided by
      the platform firmware via CPPC which may not be reliable enough.  It
      also need not be so complicated.
      
      In order to improve that mechanism and make it more resistant to
      platform firmware issues, make it only use the CPPC nominal_perf
      values to compute the HWP-to-frequency scaling factors for all
      CPUs and possibly use the HWP_CAP highest_perf values to recompute
      them if the ones derived from the CPPC nominal_perf values alone
      appear to be too high.
      
      Namely, fetch CPC.nominal_perf for all CPUs present in the system,
      find the minimum one and use it as a reference for computing all of
      the CPUs' scaling factors (using the observation that for the CPUs
      having the minimum CPC.nominal_perf the HWP range of available
      performance levels should be the same as the range of available
      "legacy" P-states and so the HWP-to-frequency scaling factor for
      them should be the same as the corresponding scaling factor used
      for representing the P-state values in kHz).
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NZhang Rui <rui.zhang@intel.com>
      46573fd6
  19. 07 9月, 2021 1 次提交
  20. 26 8月, 2021 1 次提交
    • S
      cpufreq: intel_pstate: Process HWP Guaranteed change notification · d0e936ad
      Srinivas Pandruvada 提交于
      It is possible that HWP guaranteed ratio is changed in response to
      change in power and thermal limits. For example when Intel Speed Select
      performance profile is changed or there is change in TDP, hardware can
      send notifications. It is possible that the guaranteed ratio is
      increased. This creates an issue when turbo is disabled, as the old
      limits set in MSR_HWP_REQUEST are still lower and hardware will clip
      to older limits.
      
      This change enables HWP interrupt and process HWP interrupts. When
      guaranteed is changed, calls cpufreq_update_policy() so that driver
      callbacks are called to update to new HWP limits. This callback
      is called from a delayed workqueue of 10ms to avoid frequent updates.
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d0e936ad
  21. 05 8月, 2021 1 次提交
  22. 01 7月, 2021 1 次提交
  23. 07 6月, 2021 1 次提交
  24. 22 5月, 2021 4 次提交
    • G
      cpufreq: intel_pstate: Add Cometlake support in no-HWP mode · 706c5328
      Giovanni Gherdovich 提交于
      Users may disable HWP in firmware, in which case intel_pstate wouldn't load
      unless the CPU model is explicitly supported.
      
      See also commit d8de7a44 ("cpufreq: intel_pstate: Add Skylake servers
      support").
      Suggested-by: NDoug Smythies <dsmythies@telus.net>
      Tested-by: NDoug Smythies <dsmythies@telus.net>
      Signed-off-by: NGiovanni Gherdovich <ggherdovich@suse.cz>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      706c5328
    • G
      cpufreq: intel_pstate: Add Icelake servers support in no-HWP mode · fbdc21e9
      Giovanni Gherdovich 提交于
      Users may disable HWP in firmware, in which case intel_pstate wouldn't load
      unless the CPU model is explicitly supported.
      
      Add ICELAKE_X to the list of CPUs that can register intel_pstate while not
      advertising the HWP capability. Without this change, an ICELAKE_X in no-HWP
      mode could only use the acpi_cpufreq frequency scaling driver.
      
      See also commit d8de7a44 ("cpufreq: intel_pstate: Add Skylake servers
      support").
      Signed-off-by: NGiovanni Gherdovich <ggherdovich@suse.cz>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      fbdc21e9
    • R
      cpufreq: intel_pstate: hybrid: CPU-specific scaling factor · eb3693f0
      Rafael J. Wysocki 提交于
      The scaling factor between HWP performance levels and CPU frequency
      may be different for different types of CPUs in a hybrid processor
      and in general the HWP performance levels need not correspond to
      "P-states" representing values that would be written to
      MSR_IA32_PERF_CTL if HWP was disabled.
      
      However, the policy limits control in cpufreq is defined in terms
      of CPU frequency, so it is necessary to map the frequency limits set
      through that interface to HWP performance levels with reasonable
      accuracy and the behavior of that interface on hybrid processors
      has to be compatible with its behavior on non-hybrid ones.
      
      To address this problem, use the observations that (1) on hybrid
      processors the sysfs interface can operate by mapping frequency
      to "P-states" and translating those "P-states" to specific HWP
      performance levels of the given CPU and (2) the scaling factor
      between the MSR_IA32_PERF_CTL "P-states" and CPU frequency can be
      regarded as a known value.  Moreover, the mapping between the
      HWP performance levels and CPU frequency can be assumed to be
      linear and such that HWP performance level 0 correspond to the
      frequency value of 0, so it is only necessary to know the
      frequency corresponding to one specific HWP performance level
      to compute the scaling factor applicable to all of them.
      
      One possibility is to take the nominal performance value from CPPC,
      if available, and use cpu_khz as the corresponding frequency.  If
      the CPPC capabilities interface is not there or the nominal
      performance value provided by it is out of range, though, something
      else needs to be done.
      
      Namely, the guaranteed performance level either from CPPC or from
      MSR_HWP_CAPABILITIES can be used instead, but the corresponding
      frequency needs to be determined.  That can be done by computing the
      product of the (known) scaling factor between the MSR_IA32_PERF_CTL
      P-states and CPU frequency (the PERF_CTL scaling factor) and the
      P-state value referred to as the "TDP ratio".
      
      If the HWP-to-frequency scaling factor value obtained in one of the
      ways above turns out to be euqal to the PERF_CTL scaling factor, it
      can be assumed that the number of HWP performance levels is equal to
      the number of P-states and the given CPU can be handled as though
      this was not a hybrid processor.
      
      Otherwise, one more adjustment may still need to be made, because the
      HWP-to-frequency scaling factor computed so far may not be accurate
      enough (e.g. because the CPPC information does not match the exact
      behavior of the processor).  Specifically, in that case the frequency
      corresponding to the highest HWP performance value from
      MSR_HWP_CAPABILITIES (computed as the product of that value and the
      HWP-to-frequency scaling factor) cannot exceed the frequency that
      corresponds to the maximum 1-core turbo P-state value from
      MSR_TURBO_RATIO_LIMIT (computed as the procuct of that value and the
      PERF_CTL scaling factor) and the HWP-to-frequency scaling factor may
      need to be adjusted accordingly.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      eb3693f0
    • R
      cpufreq: intel_pstate: hybrid: Avoid exposing two global attributes · c3d175e4
      Rafael J. Wysocki 提交于
      The turbo_pct and num_pstates sysfs attributes represent CPU
      properties that may be different for differenty types of CPUs in
      a hybrid processor, so avoid exposing them in that case.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c3d175e4
  25. 10 5月, 2021 1 次提交
  26. 09 4月, 2021 1 次提交
    • R
      cpufreq: intel_pstate: Simplify intel_pstate_update_perf_limits() · b989bc0f
      Rafael J. Wysocki 提交于
      Because pstate.max_freq is always equal to the product of
      pstate.max_pstate and pstate.scaling and, analogously,
      pstate.turbo_freq is always equal to the product of
      pstate.turbo_pstate and pstate.scaling, the result of the
      max_policy_perf computation in intel_pstate_update_perf_limits() is
      always equal to the quotient of policy_max and pstate.scaling,
      regardless of whether or not turbo is disabled.  Analogously, the
      result of min_policy_perf in intel_pstate_update_perf_limits() is
      always equal to the quotient of policy_min and pstate.scaling.
      
      Accordingly, intel_pstate_update_perf_limits() need not check
      whether or not turbo is enabled at all and in order to compute
      max_policy_perf and min_policy_perf it can always divide policy_max
      and policy_min, respectively, by pstate.scaling.  Make it do so.
      
      While at it, move the definition and initialization of the
      turbo_max local variable to the code branch using it.
      
      No intentional functional impact.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NChen Yu <yu.c.chen@intel.com>
      b989bc0f
  27. 24 3月, 2021 1 次提交
    • R
      cpufreq: intel_pstate: Clean up frequency computations · de5bcf40
      Rafael J. Wysocki 提交于
      Notice that some computations related to frequency in intel_pstate
      can be simplified if (a) intel_pstate_get_hwp_max() updates the
      relevant members of struct cpudata by itself and (b) the "turbo
      disabled" check is moved from it to its callers, so modify the code
      accordingly and while at it rename intel_pstate_get_hwp_max() to
      intel_pstate_get_hwp_cap() which better reflects its purpose and
      provide a simplified variat of it, __intel_pstate_get_hwp_cap(),
      suitable for the initialization path.
      
      No intentional functional impact.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NChen Yu <yu.c.chen@intel.com>
      de5bcf40
  28. 23 1月, 2021 1 次提交
  29. 13 1月, 2021 3 次提交