1. 13 7月, 2020 1 次提交
  2. 23 6月, 2020 1 次提交
  3. 27 4月, 2020 1 次提交
  4. 17 4月, 2020 1 次提交
    • R
      cpufreq: intel_pstate: Use passive mode by default without HWP · 33aa46f2
      Rafael J. Wysocki 提交于
      After recent changes allowing scale-invariant utilization to be
      used on x86, the schedutil governor on top of intel_pstate in the
      passive mode should be on par with (or better than) the active mode
      "powersave" algorithm of intel_pstate on systems in which
      hardware-managed P-states (HWP) are not used, so it should not be
      necessary to use the internal scaling algorithm in those cases.
      
      Accordingly, modify intel_pstate to start in the passive mode by
      default if the processor at hand does not support HWP of if the driver
      is requested to avoid using HWP through the kernel command line.
      
      Among other things, that will allow utilization clamps and the
      support for RT/DL tasks in the schedutil governor to be utilized on
      systems in which intel_pstate is used.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      33aa46f2
  5. 27 3月, 2020 1 次提交
    • R
      cpufreq: intel_pstate: Simplify intel_pstate_cpu_init() · 5ac54113
      Rafael J. Wysocki 提交于
      The initial policy value set by intel_pstate_cpu_init() depends on
      whether or not CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is set, but
      that is not necessary, because the core will set the policy to
      "performance" in cpufreq_init_policy() if the default governor is
      "performance" anyway.
      
      Accordingly, change intel_pstate_cpu_init() to always set policy
      to CPUFREQ_POLICY_POWERSAVE initially to provide a valid fallback
      value to cpufreq_init_policy() in case the default cpufreq governor
      is neither "powersave" nor "performance".
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      5ac54113
  6. 25 3月, 2020 2 次提交
  7. 14 3月, 2020 1 次提交
  8. 29 1月, 2020 1 次提交
  9. 27 1月, 2020 1 次提交
    • R
      cpufreq: Avoid creating excessively large stack frames · 1e4f63ae
      Rafael J. Wysocki 提交于
      In the process of modifying a cpufreq policy, the cpufreq core makes
      a copy of it including all of the internals which is stored on the
      CPU stack.  Because struct cpufreq_policy is relatively large, this
      may cause the size of the stack frame to exceed the 2 KB limit and
      so the GCC complains when -Wframe-larger-than= is used.
      
      In fact, it is not necessary to copy the entire policy structure
      in order to modify it, however.
      
      First, because cpufreq_set_policy() obtains the min and max policy
      limits from frequency QoS now, it is not necessary to pass the limits
      to it from the callers.  The only things that need to be passed to it
      from there are the new governor pointer or (if there is a built-in
      governor in the driver) the "policy" value representing the governor
      choice.  They both can be passed as individual arguments, though, so
      make cpufreq_set_policy() take them this way and rework its callers
      accordingly.  This avoids making copies of cpufreq policies in the
      callers of cpufreq_set_policy().
      
      Second, cpufreq_set_policy() still needs to pass the new policy
      data to the ->verify() callback of the cpufreq driver whose task
      is to sanitize the min and max policy limits.  It still does not
      need to make a full copy of struct cpufreq_policy for this purpose,
      but it needs to pass a few items from it to the driver in case they
      are needed (different drivers have different needs in that respect
      and all of them have to be covered).  For this reason, introduce
      struct cpufreq_policy_data to hold copies of the members of
      struct cpufreq_policy used by the existing ->verify() driver
      callbacks and pass a pointer to a temporary structure of that
      type to ->verify() (instead of passing a pointer to full struct
      cpufreq_policy to it).
      
      While at it, notice that intel_pstate and longrun don't really need
      to verify the "policy" value in struct cpufreq_policy, so drop those
      check from them to avoid copying "policy" into struct
      cpufreq_policy_data (which allows it to be slightly smaller).
      
      Also while at it fix up white space in a couple of places and make
      cpufreq_set_policy() static (as it can be so).
      
      Fixes: 3000ce3c ("cpufreq: Use per-policy frequency QoS")
      Link: https://lore.kernel.org/linux-pm/CAMuHMdX6-jb1W8uC2_237m8ctCpsnGp=JCxqt8pCWVqNXHmkVg@mail.gmail.comReported-by: Nkbuild test robot <lkp@intel.com>
      Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: 5.4+ <stable@vger.kernel.org> # 5.4+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      1e4f63ae
  10. 13 1月, 2020 1 次提交
  11. 08 11月, 2019 1 次提交
  12. 06 11月, 2019 1 次提交
  13. 21 10月, 2019 1 次提交
  14. 28 8月, 2019 4 次提交
  15. 21 8月, 2019 1 次提交
    • V
      cpufreq: intel_pstate: Implement QoS supported freq constraints · da5c504c
      Viresh Kumar 提交于
      Intel pstate driver exposes min_perf_pct and max_perf_pct sysfs files,
      which can be used to force a limit on the min/max P state of the driver.
      Though these files eventually control the min/max frequencies that the
      CPUs will run at, they don't make a change to policy->min/max values.
      
      When the values of these files are changed (in passive mode of the
      driver), it leads to calling ->limits() callback of the cpufreq
      governors, like schedutil. On a call to it the governors shall
      forcefully update the frequency to come within the limits. Since the
      limits, i.e.  policy->min/max, aren't updated by the driver, the
      governors fails to get the target freq within limit and sometimes aborts
      the update believing that the frequency is already set to the target
      value.
      
      This patch implements the QoS supported frequency constraints to update
      policy->min/max values whenever min_perf_pct or max_perf_pct files are
      updated. This is only done for the passive mode as of now, as the driver
      is already working fine in active mode.
      
      Fixes: ecd28842 ("cpufreq: schedutil: Don't set next_freq to UINT_MAX")
      Reported-by: NDoug Smythies <dsmythies@telus.net>
      Tested-by: NDoug Smythies <dsmythies@telus.net>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      da5c504c
  16. 09 7月, 2019 1 次提交
  17. 05 6月, 2019 1 次提交
  18. 08 4月, 2019 2 次提交
  19. 02 4月, 2019 2 次提交
  20. 26 3月, 2019 1 次提交
  21. 12 3月, 2019 1 次提交
    • R
      cpufreq: intel_pstate: Fix up iowait_boost computation · 8e3b4039
      Rafael J. Wysocki 提交于
      After commit b8bd1581 ("cpufreq: intel_pstate: Rework iowait
      boosting to be less aggressive") the handling of the case when
      the SCHED_CPUFREQ_IOWAIT flag is set again after a few iterations of
      intel_pstate_update_util() is a bit inconsistent, because the
      new value of cpu->iowait_boost may be lower than ONE_EIGHTH_FP
      if it was set before, but has not dropped down to zero just yet.
      
      Fix that up by ensuring that the new value of cpu->iowait_boost
      will always be at least ONE_EIGHTH_FP then.
      
      Fixes: b8bd1581 ("cpufreq: intel_pstate: Rework iowait boosting to be less aggressive")
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8e3b4039
  22. 18 2月, 2019 3 次提交
  23. 13 2月, 2019 1 次提交
    • E
      cpufreq: intel_pstate: Add reasons for failure and debug messages · 076b862c
      Erwan Velu 提交于
      The init code path has several exceptions where the driver can
      decide not to load.
      
      As CONFIG_X86_INTEL_PSTATE is generally set to Y, the return code is
      not reachable.  The initialization code is neither verbose of the
      reason why it did choose to prematurely exit, so it is difficult for
      a user to determine, on a given platform, why the driver didn't load
      properly.
      
      This patch is about reporting to the user the reason/context of why
      the driver failed to load.  That is a precious hint when debugging
      a platform.
      Signed-off-by: NErwan Velu <e.velu@criteo.com>
      [ rjw: Subject & changelog, minor fixups ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      076b862c
  24. 29 1月, 2019 1 次提交
    • V
      cpufreq: Use struct kobj_attribute instead of struct global_attr · 625c85a6
      Viresh Kumar 提交于
      The cpufreq_global_kobject is created using kobject_create_and_add()
      helper, which assigns the kobj_type as dynamic_kobj_ktype and show/store
      routines are set to kobj_attr_show() and kobj_attr_store().
      
      These routines pass struct kobj_attribute as an argument to the
      show/store callbacks. But all the cpufreq files created using the
      cpufreq_global_kobject expect the argument to be of type struct
      attribute. Things work fine currently as no one accesses the "attr"
      argument. We may not see issues even if the argument is used, as struct
      kobj_attribute has struct attribute as its first element and so they
      will both get same address.
      
      But this is logically incorrect and we should rather use struct
      kobj_attribute instead of struct global_attr in the cpufreq core and
      drivers and the show/store callbacks should take struct kobj_attribute
      as argument instead.
      
      This bug is caught using CFI CLANG builds in android kernel which
      catches mismatch in function prototypes for such callbacks.
      Reported-by: NDonghee Han <dh.han@samsung.com>
      Reported-by: NSangkyu Kim <skwith.kim@samsung.com>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      625c85a6
  25. 30 11月, 2018 1 次提交
  26. 28 11月, 2018 1 次提交
  27. 26 10月, 2018 1 次提交
  28. 16 10月, 2018 1 次提交
  29. 02 10月, 2018 1 次提交
    • P
      x86/cpu: Sanitize FAM6_ATOM naming · f2c4db1b
      Peter Zijlstra 提交于
      Going primarily by:
      
        https://en.wikipedia.org/wiki/List_of_Intel_Atom_microprocessors
      
      with additional information gleaned from other related pages; notably:
      
       - Bonnell shrink was called Saltwell
       - Moorefield is the Merriefield refresh which makes it Airmont
      
      The general naming scheme is: FAM6_ATOM_UARCH_SOCTYPE
      
        for i in `git grep -l FAM6_ATOM` ; do
      	sed -i  -e 's/ATOM_PINEVIEW/ATOM_BONNELL/g'		\
      		-e 's/ATOM_LINCROFT/ATOM_BONNELL_MID/'		\
      		-e 's/ATOM_PENWELL/ATOM_SALTWELL_MID/g'		\
      		-e 's/ATOM_CLOVERVIEW/ATOM_SALTWELL_TABLET/g'	\
      		-e 's/ATOM_CEDARVIEW/ATOM_SALTWELL/g'		\
      		-e 's/ATOM_SILVERMONT1/ATOM_SILVERMONT/g'	\
      		-e 's/ATOM_SILVERMONT2/ATOM_SILVERMONT_X/g'	\
      		-e 's/ATOM_MERRIFIELD/ATOM_SILVERMONT_MID/g'	\
      		-e 's/ATOM_MOOREFIELD/ATOM_AIRMONT_MID/g'	\
      		-e 's/ATOM_DENVERTON/ATOM_GOLDMONT_X/g'		\
      		-e 's/ATOM_GEMINI_LAKE/ATOM_GOLDMONT_PLUS/g' ${i}
        done
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: dave.hansen@linux.intel.com
      Cc: len.brown@intel.com
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      f2c4db1b
  30. 06 8月, 2018 1 次提交
  31. 31 7月, 2018 1 次提交
  32. 19 7月, 2018 1 次提交
    • S
      cpufreq: intel_pstate: Show different max frequency with turbo 3 and HWP · eea033d0
      Srinivas Pandruvada 提交于
      On HWP platforms with Turbo 3.0, the HWP capability max ratio shows the
      maximum ratio of that core, which can be different than other cores. If
      we show the correct maximum frequency in cpufreq sysfs via
      cpuinfo_max_freq and scaling_max_freq then, user can know which cores
      can run faster for pinning some high priority tasks.
      
      Currently the max turbo frequency is shown as max frequency, which is
      the max of all cores, even if some cores can't reach that frequency
      even for single threaded workload.
      
      But it is possible that max ratio in HWP capabilities is set as 0xFF or
      some high invalid value (E.g. One KBL NUC). Since the actual performance
      can never exceed 1 core turbo frequency from MSR TURBO_RATIO_LIMIT, we
      use this as a bound check.
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      eea033d0