1. 02 4月, 2016 2 次提交
  2. 09 3月, 2016 31 次提交
  3. 10 12月, 2015 2 次提交
    • R
      cpufreq: governor: Use lockless timer function · 2dd3e724
      Rafael J. Wysocki 提交于
      It is possible to get rid of the timer_lock spinlock used by the
      governor timer function for synchronization, but a couple of races
      need to be avoided.
      
      The first race is between multiple dbs_timer_handler() instances
      that may be running in parallel with each other on different
      CPUs.  Namely, one of them has to queue up the work item, but it
      cannot be queued up more than once.  To achieve that,
      atomic_inc_return() can be used on the skip_work field of
      struct cpu_common_dbs_info.
      
      The second race is between an already running dbs_timer_handler()
      and gov_cancel_work().  In that case the dbs_timer_handler() might
      not notice the skip_work incrementation in gov_cancel_work() and
      it might queue up its work item after gov_cancel_work() had
      returned (and that work item would corrupt skip_work going
      forward).  To prevent that from happening, gov_cancel_work()
      can be made wait for the timer function to complete (on all CPUs)
      right after skip_work has been incremented.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      2dd3e724
    • V
      cpufreq: governor: replace per-CPU delayed work with timers · 70f43e5e
      Viresh Kumar 提交于
      cpufreq governors evaluate load at sampling rate and based on that they
      update frequency for a group of CPUs belonging to the same cpufreq
      policy.
      
      This is required to be done in a single thread for all policy->cpus, but
      because we don't want to wakeup idle CPUs to do just that, we use
      deferrable work for this. If we would have used a single delayed
      deferrable work for the entire policy, there were chances that the CPU
      required to run the handler can be in idle and we might end up not
      changing the frequency for the entire group with load variations.
      
      And so we were forced to keep per-cpu works, and only the one that
      expires first need to do the real work and others are rescheduled for
      next sampling time.
      
      We have been using the more complex solution until now, where we used a
      delayed deferrable work for this, which is a combination of a timer and
      a work.
      
      This could be made lightweight by keeping per-cpu deferred timers with a
      single work item, which is scheduled by the first timer that expires.
      
      This patch does just that and here are important changes:
      - The timer handler will run in irq context and so we need to use a
        spin_lock instead of the timer_mutex. And so a separate timer_lock is
        created. This also makes the use of the mutex and lock quite clear, as
        we know what exactly they are protecting.
      - A new field 'skip_work' is added to track when the timer handlers can
        queue a work. More comments present in code.
      Suggested-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Reviewed-by: NAshwin Chaugule <ashwin.chaugule@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      70f43e5e
  4. 07 12月, 2015 1 次提交
  5. 26 9月, 2015 1 次提交
  6. 21 7月, 2015 2 次提交
  7. 18 7月, 2015 1 次提交