]> Git Repo - linux.git/commitdiff
Merge tag 'pm-5.12-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
authorLinus Torvalds <[email protected]>
Tue, 23 Feb 2021 22:59:46 +0000 (14:59 -0800)
committerLinus Torvalds <[email protected]>
Tue, 23 Feb 2021 22:59:46 +0000 (14:59 -0800)
Pull more power management updates from Rafael Wysocki:
 "These are fixes and cleanups on top of the power management material
  for 5.12-rc1 merged previously.

  Specifics:

   - Address cpufreq regression introduced in 5.11 that causes CPU
     frequency reporting to be distorted on systems with CPPC that use
     acpi-cpufreq as the scaling driver (Rafael Wysocki).

   - Fix regression introduced during the 5.10 development cycle related
     to CPU hotplug and policy recreation in the qcom-cpufreq-hw driver
     (Shawn Guo).

   - Fix recent regression in the operating performance points (OPP)
     framework that may cause frequency updates to be skipped by mistake
     in some cases (Jonathan Marek).

   - Simplify schedutil governor code and remove a misleading comment
     from it (Yue Hu).

   - Fix kerneldoc comment typo in the cpufreq core (Yue Hu)"

* tag 'pm-5.12-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: Fix typo in kerneldoc comment
  cpufreq: schedutil: Remove update_lock comment from struct sugov_policy definition
  cpufreq: schedutil: Remove needless sg_policy parameter from ignore_dl_rate_limit()
  cpufreq: ACPI: Set cpuinfo.max_freq directly if max boost is known
  cpufreq: qcom-hw: drop devm_xxx() calls from init/exit hooks
  opp: Don't skip freq update for different frequency

1  2 
kernel/sched/cpufreq_schedutil.c

index 41e498b0008a6c415d7e8ebd3d5babf65f3aa0d6,fe7df039ce9e956ad1b218f64849ed3fc6e78201..50cbad89f7faf2be3035e9d1d0362cd673f1f322
@@@ -26,7 -26,7 +26,7 @@@ struct sugov_policy 
        struct sugov_tunables   *tunables;
        struct list_head        tunables_hook;
  
-       raw_spinlock_t          update_lock;    /* For shared policies */
+       raw_spinlock_t          update_lock;
        u64                     last_freq_update_time;
        s64                     freq_update_delay_ns;
        unsigned int            next_freq;
@@@ -171,6 -171,112 +171,6 @@@ static unsigned int get_next_freq(struc
        return cpufreq_driver_resolve_freq(policy, freq);
  }
  
 -/*
 - * This function computes an effective utilization for the given CPU, to be
 - * used for frequency selection given the linear relation: f = u * f_max.
 - *
 - * The scheduler tracks the following metrics:
 - *
 - *   cpu_util_{cfs,rt,dl,irq}()
 - *   cpu_bw_dl()
 - *
 - * Where the cfs,rt and dl util numbers are tracked with the same metric and
 - * synchronized windows and are thus directly comparable.
 - *
 - * The cfs,rt,dl utilization are the running times measured with rq->clock_task
 - * which excludes things like IRQ and steal-time. These latter are then accrued
 - * in the irq utilization.
 - *
 - * The DL bandwidth number otoh is not a measured metric but a value computed
 - * based on the task model parameters and gives the minimal utilization
 - * required to meet deadlines.
 - */
 -unsigned long schedutil_cpu_util(int cpu, unsigned long util_cfs,
 -                               unsigned long max, enum schedutil_type type,
 -                               struct task_struct *p)
 -{
 -      unsigned long dl_util, util, irq;
 -      struct rq *rq = cpu_rq(cpu);
 -
 -      if (!uclamp_is_used() &&
 -          type == FREQUENCY_UTIL && rt_rq_is_runnable(&rq->rt)) {
 -              return max;
 -      }
 -
 -      /*
 -       * Early check to see if IRQ/steal time saturates the CPU, can be
 -       * because of inaccuracies in how we track these -- see
 -       * update_irq_load_avg().
 -       */
 -      irq = cpu_util_irq(rq);
 -      if (unlikely(irq >= max))
 -              return max;
 -
 -      /*
 -       * Because the time spend on RT/DL tasks is visible as 'lost' time to
 -       * CFS tasks and we use the same metric to track the effective
 -       * utilization (PELT windows are synchronized) we can directly add them
 -       * to obtain the CPU's actual utilization.
 -       *
 -       * CFS and RT utilization can be boosted or capped, depending on
 -       * utilization clamp constraints requested by currently RUNNABLE
 -       * tasks.
 -       * When there are no CFS RUNNABLE tasks, clamps are released and
 -       * frequency will be gracefully reduced with the utilization decay.
 -       */
 -      util = util_cfs + cpu_util_rt(rq);
 -      if (type == FREQUENCY_UTIL)
 -              util = uclamp_rq_util_with(rq, util, p);
 -
 -      dl_util = cpu_util_dl(rq);
 -
 -      /*
 -       * For frequency selection we do not make cpu_util_dl() a permanent part
 -       * of this sum because we want to use cpu_bw_dl() later on, but we need
 -       * to check if the CFS+RT+DL sum is saturated (ie. no idle time) such
 -       * that we select f_max when there is no idle time.
 -       *
 -       * NOTE: numerical errors or stop class might cause us to not quite hit
 -       * saturation when we should -- something for later.
 -       */
 -      if (util + dl_util >= max)
 -              return max;
 -
 -      /*
 -       * OTOH, for energy computation we need the estimated running time, so
 -       * include util_dl and ignore dl_bw.
 -       */
 -      if (type == ENERGY_UTIL)
 -              util += dl_util;
 -
 -      /*
 -       * There is still idle time; further improve the number by using the
 -       * irq metric. Because IRQ/steal time is hidden from the task clock we
 -       * need to scale the task numbers:
 -       *
 -       *              max - irq
 -       *   U' = irq + --------- * U
 -       *                 max
 -       */
 -      util = scale_irq_capacity(util, irq, max);
 -      util += irq;
 -
 -      /*
 -       * Bandwidth required by DEADLINE must always be granted while, for
 -       * FAIR and RT, we use blocked utilization of IDLE CPUs as a mechanism
 -       * to gracefully reduce the frequency when no tasks show up for longer
 -       * periods of time.
 -       *
 -       * Ideally we would like to set bw_dl as min/guaranteed freq and util +
 -       * bw_dl as requested freq. However, cpufreq is not yet ready for such
 -       * an interface. So, we only do the latter for now.
 -       */
 -      if (type == FREQUENCY_UTIL)
 -              util += cpu_bw_dl(rq);
 -
 -      return min(max, util);
 -}
 -
  static void sugov_get_util(struct sugov_cpu *sg_cpu)
  {
        struct rq *rq = cpu_rq(sg_cpu->cpu);
  
        sg_cpu->max = max;
        sg_cpu->bw_dl = cpu_bw_dl(rq);
 -      sg_cpu->util = schedutil_cpu_util(sg_cpu->cpu, cpu_util_cfs(rq), max,
 +      sg_cpu->util = effective_cpu_util(sg_cpu->cpu, cpu_util_cfs(rq), max,
                                          FREQUENCY_UTIL, NULL);
  }
  
@@@ -320,23 -426,21 +320,21 @@@ static inline bool sugov_cpu_is_busy(st
   * Make sugov_should_update_freq() ignore the rate limit when DL
   * has increased the utilization.
   */
- static inline void ignore_dl_rate_limit(struct sugov_cpu *sg_cpu, struct sugov_policy *sg_policy)
+ static inline void ignore_dl_rate_limit(struct sugov_cpu *sg_cpu)
  {
        if (cpu_bw_dl(cpu_rq(sg_cpu->cpu)) > sg_cpu->bw_dl)
-               sg_policy->limits_changed = true;
+               sg_cpu->sg_policy->limits_changed = true;
  }
  
  static inline bool sugov_update_single_common(struct sugov_cpu *sg_cpu,
                                              u64 time, unsigned int flags)
  {
-       struct sugov_policy *sg_policy = sg_cpu->sg_policy;
        sugov_iowait_boost(sg_cpu, time, flags);
        sg_cpu->last_update = time;
  
-       ignore_dl_rate_limit(sg_cpu, sg_policy);
+       ignore_dl_rate_limit(sg_cpu);
  
-       if (!sugov_should_update_freq(sg_policy, time))
+       if (!sugov_should_update_freq(sg_cpu->sg_policy, time))
                return false;
  
        sugov_get_util(sg_cpu);
@@@ -451,7 -555,7 +449,7 @@@ sugov_update_shared(struct update_util_
        sugov_iowait_boost(sg_cpu, time, flags);
        sg_cpu->last_update = time;
  
-       ignore_dl_rate_limit(sg_cpu, sg_policy);
+       ignore_dl_rate_limit(sg_cpu);
  
        if (sugov_should_update_freq(sg_policy, time)) {
                next_f = sugov_next_freq_shared(sg_cpu, time);
This page took 0.065482 seconds and 4 git commands to generate.