1. 06 10月, 2015 4 次提交
  2. 03 10月, 2015 1 次提交
  3. 01 10月, 2015 1 次提交
  4. 23 9月, 2015 6 次提交
  5. 21 9月, 2015 1 次提交
    • P
      rcu: Suppress lockdep false positive for rcp->exp_funnel_mutex · 19a5ecde
      Paul E. McKenney 提交于
      In kernels built with CONFIG_PREEMPT=y, synchronize_rcu_expedited()
      invokes synchronize_sched_expedited() while holding RCU-preempt's
      root rcu_node structure's ->exp_funnel_mutex, which is acquired after
      the rcu_data structure's ->exp_funnel_mutex.  The first thing that
      synchronize_sched_expedited() will do is acquire RCU-sched's rcu_data
      structure's ->exp_funnel_mutex.   There is no danger of an actual deadlock
      because the locking order is always from RCU-preempt's expedited mutexes
      to those of RCU-sched.  Unfortunately, lockdep considers both rcu_data
      structures' ->exp_funnel_mutex to be in the same lock class and therefore
      reports a deadlock cycle.
      
      This commit silences this false positive by placing RCU-sched's rcu_data
      structures' ->exp_funnel_mutex locks into their own lock class.
      Reported-by: NSasha Levin <sasha.levin@oracle.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      19a5ecde
  6. 18 9月, 2015 9 次提交
  7. 16 9月, 2015 7 次提交
  8. 14 9月, 2015 1 次提交
  9. 13 9月, 2015 10 次提交
    • J
      time: Fix timekeeping_freqadjust()'s incorrect use of abs() instead of abs64() · 2619d7e9
      John Stultz 提交于
      The internal clocksteering done for fine-grained error
      correction uses a logarithmic approximation, so any time
      adjtimex() adjusts the clock steering, timekeeping_freqadjust()
      quickly approximates the correct clock frequency over a series
      of ticks.
      
      Unfortunately, the logic in timekeeping_freqadjust(), introduced
      in commit:
      
        dc491596 ("timekeeping: Rework frequency adjustments to work better w/ nohz")
      
      used the abs() function with a s64 error value to calculate the
      size of the approximated adjustment to be made.
      
      Per include/linux/kernel.h:
      
        "abs() should not be used for 64-bit types (s64, u64, long long) - use abs64()".
      
      Thus on 32-bit platforms, this resulted in the clocksteering to
      take a quite dampended random walk trying to converge on the
      proper frequency, which caused the adjustments to be made much
      slower then intended (most easily observed when large
      adjustments are made).
      
      This patch fixes the issue by using abs64() instead.
      Reported-by: NNuno Gonçalves <nunojpg@gmail.com>
      Tested-by: NNuno Goncalves <nunojpg@gmail.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      Cc: <stable@vger.kernel.org> # v3.17+
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Miroslav Lichvar <mlichvar@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/1441840051-20244-1-git-send-email-john.stultz@linaro.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      2619d7e9
    • P
      sched/fair: Optimize per entity utilization tracking · 006cdf02
      Peter Zijlstra 提交于
      Currently the load_{sum,avg} and util_{sum,avg} tracking is asymmetric
      in that load tracking gets a 2^10 unit from the weight, but util gets
      no such factor.
      
      This results in more lost bits for util scaling and asymmetric scaling
      rules.
      
      Fix this by removing shifts, such that we gain the 2^10 factor from
      scaling. There is no risk of overflowing the u32 as the max value is
      now LOAD_AVG_MAX << 10, which is still well below UINT_MAX.
      
      This further entangles the assumption that both LOAD and CAPACITY
      shifts are the same (and 10) so put in an assertion for that.
      
      This fixes the math for the LOAD_RESOLUTION != 0 case.
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      006cdf02
    • D
      sched/fair: Defer calling scaling functions · 6f2b0452
      Dietmar Eggemann 提交于
      Do not call the scaling functions in case time goes backwards or the
      last update of the sched_avg structure has happened less than 1024ns
      ago.
      Signed-off-by: NDietmar Eggemann <dietmar.eggemann@arm.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Juri Lelli <Juri.Lelli@arm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: daniel.lezcano@linaro.org <daniel.lezcano@linaro.org>
      Cc: mturquette@baylibre.com <mturquette@baylibre.com>
      Cc: pang.xunlei@zte.com.cn <pang.xunlei@zte.com.cn>
      Cc: rjw@rjwysocki.net <rjw@rjwysocki.net>
      Cc: sgurrappadi@nvidia.com <sgurrappadi@nvidia.com>
      Cc: vincent.guittot@linaro.org <vincent.guittot@linaro.org>
      Cc: yuyang.du@intel.com <yuyang.du@intel.com>
      Link: http://lkml.kernel.org/r/55EDA2E9.8040900@arm.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      6f2b0452
    • P
      sched/fair: Optimize __update_load_avg() · 6115c793
      Peter Zijlstra 提交于
      Prior to this patch; the line:
      
      	scaled_delta_w = (delta_w * 1024) >> 10;
      
      which is the result of the default arch_scale_freq_capacity()
      function, turns into:
      
          1b03:	49 89 d1             	mov    %rdx,%r9
          1b06:	49 c1 e1 0a          	shl    $0xa,%r9
          1b0a:	49 c1 e9 0a          	shr    $0xa,%r9
      
      Which is silly; when made unsigned int, GCC recognises this as
      pointless ops and fails to emit them (confirmed on 4.9.3 and 5.1.1).
      
      Furthermore, afaict unsigned is actually the correct type for these
      fields anyway, as we've explicitly ruled out negative delta's earlier
      in this function.
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      6115c793
    • P
      sched/fair: Rename scale() to cap_scale() · 54a21385
      Peter Zijlstra 提交于
      Rename scale() to cap_scale() to better reflect its purpose, it is
      after all not a general purpose scale function, it has
      SCHED_CAPACITY_SHIFT hardcoded in it.
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      54a21385
    • M
      sched/fair: Initialize task load and utilization before placing task on rq · 98d8fd81
      Morten Rasmussen 提交于
      Task load or utilization is not currently considered in
      select_task_rq_fair(), but if we want that in the future we should make
      sure it is not zero for new tasks.
      
      cc: Ingo Molnar <mingo@redhat.com>
      cc: Peter Zijlstra <peterz@infradead.org>
      Signed-off-by: NMorten Rasmussen <morten.rasmussen@arm.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Dietmar Eggemann <Dietmar.Eggemann@arm.com>
      Cc: Juri Lelli <Juri.Lelli@arm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: daniel.lezcano@linaro.org
      Cc: mturquette@baylibre.com
      Cc: pang.xunlei@zte.com.cn
      Cc: rjw@rjwysocki.net
      Cc: sgurrappadi@nvidia.com
      Cc: vincent.guittot@linaro.org
      Cc: yuyang.du@intel.com
      Link: http://lkml.kernel.org/r/1439569394-11974-7-git-send-email-morten.rasmussen@arm.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      98d8fd81
    • D
      sched/fair: Get rid of scaling utilization by capacity_orig · 231678b7
      Dietmar Eggemann 提交于
      Utilization is currently scaled by capacity_orig, but since we now have
      frequency and cpu invariant cfs_rq.avg.util_avg, frequency and cpu scaling
      now happens as part of the utilization tracking itself.
      So cfs_rq.avg.util_avg should no longer be scaled in cpu_util().
      Signed-off-by: NDietmar Eggemann <dietmar.eggemann@arm.com>
      Signed-off-by: NMorten Rasmussen <morten.rasmussen@arm.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Juri Lelli <Juri.Lelli@arm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Steve Muckle <steve.muckle@linaro.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: daniel.lezcano@linaro.org <daniel.lezcano@linaro.org>
      Cc: mturquette@baylibre.com <mturquette@baylibre.com>
      Cc: pang.xunlei@zte.com.cn <pang.xunlei@zte.com.cn>
      Cc: rjw@rjwysocki.net <rjw@rjwysocki.net>
      Cc: sgurrappadi@nvidia.com <sgurrappadi@nvidia.com>
      Cc: vincent.guittot@linaro.org <vincent.guittot@linaro.org>
      Cc: yuyang.du@intel.com <yuyang.du@intel.com>
      Link: http://lkml.kernel.org/r/55EDAF43.30500@arm.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      231678b7
    • D
      sched/fair: Name utilization related data and functions consistently · 9e91d61d
      Dietmar Eggemann 提交于
      Use the advent of the per-entity load tracking rewrite to streamline the
      naming of utilization related data and functions by using
      {prefix_}util{_suffix} consistently. Moreover call both signals
      ({se,cfs}.avg.util_avg) utilization.
      Signed-off-by: NDietmar Eggemann <dietmar.eggemann@arm.com>
      Signed-off-by: NMorten Rasmussen <morten.rasmussen@arm.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Dietmar Eggemann <Dietmar.Eggemann@arm.com>
      Cc: Juri Lelli <Juri.Lelli@arm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: daniel.lezcano@linaro.org
      Cc: mturquette@baylibre.com
      Cc: pang.xunlei@zte.com.cn
      Cc: rjw@rjwysocki.net
      Cc: sgurrappadi@nvidia.com
      Cc: vincent.guittot@linaro.org
      Cc: yuyang.du@intel.com
      Link: http://lkml.kernel.org/r/1439569394-11974-5-git-send-email-morten.rasmussen@arm.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      9e91d61d
    • D
      sched/fair: Make utilization tracking CPU scale-invariant · e3279a2e
      Dietmar Eggemann 提交于
      Besides the existing frequency scale-invariance correction factor, apply
      CPU scale-invariance correction factor to utilization tracking to
      compensate for any differences in compute capacity. This could be due to
      micro-architectural differences (i.e. instructions per seconds) between
      cpus in HMP systems (e.g. big.LITTLE), and/or differences in the current
      maximum frequency supported by individual cpus in SMP systems. In the
      existing implementation utilization isn't comparable between cpus as it
      is relative to the capacity of each individual CPU.
      
      Each segment of the sched_avg.util_sum geometric series is now scaled
      by the CPU performance factor too so the sched_avg.util_avg of each
      sched entity will be invariant from the particular CPU of the HMP/SMP
      system on which the sched entity is scheduled.
      
      With this patch, the utilization of a CPU stays relative to the max CPU
      performance of the fastest CPU in the system.
      
      In contrast to utilization (sched_avg.util_sum), load
      (sched_avg.load_sum) should not be scaled by compute capacity. The
      utilization metric is based on running time which only makes sense when
      cpus are _not_ fully utilized (utilization cannot go beyond 100% even if
      more tasks are added), where load is runnable time which isn't limited
      by the capacity of the CPU and therefore is a better metric for
      overloaded scenarios. If we run two nice-0 busy loops on two cpus with
      different compute capacity their load should be similar since their
      compute demands are the same. We have to assume that the compute demand
      of any task running on a fully utilized CPU (no spare cycles = 100%
      utilization) is high and the same no matter of the compute capacity of
      its current CPU, hence we shouldn't scale load by CPU capacity.
      Signed-off-by: NDietmar Eggemann <dietmar.eggemann@arm.com>
      Signed-off-by: NMorten Rasmussen <morten.rasmussen@arm.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/55CE7409.1000700@arm.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      e3279a2e
    • M
      sched/fair: Convert arch_scale_cpu_capacity() from weak function to #define · 8cd5601c
      Morten Rasmussen 提交于
      Bring arch_scale_cpu_capacity() in line with the recent change of its
      arch_scale_freq_capacity() sibling in commit dfbca41f ("sched:
      Optimize freq invariant accounting") from weak function to #define to
      allow inlining of the function.
      
      While at it, remove the ARCH_CAPACITY sched_feature as well. With the
      change to #define there isn't a straightforward way to allow runtime
      switch between an arch implementation and the default implementation of
      arch_scale_cpu_capacity() using sched_feature. The default was to use
      the arch-specific implementation, but only the arm architecture provides
      one and that is essentially equivalent to the default implementation.
      Signed-off-by: NMorten Rasmussen <morten.rasmussen@arm.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Dietmar Eggemann <Dietmar.Eggemann@arm.com>
      Cc: Juri Lelli <Juri.Lelli@arm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: daniel.lezcano@linaro.org
      Cc: mturquette@baylibre.com
      Cc: pang.xunlei@zte.com.cn
      Cc: rjw@rjwysocki.net
      Cc: sgurrappadi@nvidia.com
      Cc: vincent.guittot@linaro.org
      Cc: yuyang.du@intel.com
      Link: http://lkml.kernel.org/r/1439569394-11974-3-git-send-email-morten.rasmussen@arm.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      8cd5601c