1. 15 7月, 2012 6 次提交
  2. 12 7月, 2012 3 次提交
  3. 06 7月, 2012 1 次提交
  4. 12 6月, 2012 5 次提交
    • F
      nohz: Move next idle expiry time record into idle logic area · 84bf1bcc
      Frederic Weisbecker 提交于
      The next idle expiry time record and idle sleeps tracking are
      statistics that only concern idle.
      
      Since we want the nohz APIs to become usable further idle
      context, let's pull up the handling of these statistics to the
      callers in idle.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Alessio Igor Bogani <abogani@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Avi Kivity <avi@redhat.com>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Geoff Levand <geoff@infradead.org>
      Cc: Gilad Ben Yossef <gilad@benyossef.com>
      Cc: Hakan Akkan <hakanakkan@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Kevin Hilman <khilman@ti.com>
      Cc: Max Krasnyansky <maxk@qualcomm.com>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephen Hemminger <shemminger@vyatta.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      84bf1bcc
    • F
      nohz: Move ts->idle_calls incrementation into strict idle logic · 5b39939a
      Frederic Weisbecker 提交于
      Since we want to prepare for making the nohz API to work further
      the idle case, we need to pull ts->idle_calls incrementation up to
      the callers in idle.
      
      To perform this, we split tick_nohz_stop_sched_tick() in two parts:
      a first one that checks if we can really stop the tick for idle,
      and another that actually stops it. Then from the callers in idle,
      we check if we can stop the tick and only then we increment idle_calls
      and finally relay to the nohz API that won't care about these details
      anymore.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Alessio Igor Bogani <abogani@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Avi Kivity <avi@redhat.com>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Geoff Levand <geoff@infradead.org>
      Cc: Gilad Ben Yossef <gilad@benyossef.com>
      Cc: Hakan Akkan <hakanakkan@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Kevin Hilman <khilman@ti.com>
      Cc: Max Krasnyansky <maxk@qualcomm.com>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephen Hemminger <shemminger@vyatta.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      5b39939a
    • F
      nohz: Rename ts->idle_tick to ts->last_tick · f5d411c9
      Frederic Weisbecker 提交于
      Now that idle and nohz logics are going to be independant each others,
      ts->idle_tick becomes too much a biased name to describe the field that
      saves the last scheduled tick on top of which we re-calculate the next
      tick to schedule when the timer is restarted.
      
      We want to reuse this even to stop the tick outside idle cases. So let's
      rename it to some more generic name: ts->last_tick.
      
      This changes a bit the timer list stat export so we need to increase its
      version.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Alessio Igor Bogani <abogani@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Avi Kivity <avi@redhat.com>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Geoff Levand <geoff@infradead.org>
      Cc: Gilad Ben Yossef <gilad@benyossef.com>
      Cc: Hakan Akkan <hakanakkan@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Kevin Hilman <khilman@ti.com>
      Cc: Max Krasnyansky <maxk@qualcomm.com>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephen Hemminger <shemminger@vyatta.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      f5d411c9
    • F
      nohz: Make nohz API agnostic against idle ticks cputime accounting · 2ac0d98f
      Frederic Weisbecker 提交于
      When the timer tick fires, it accounts the new jiffy as either part
      of system, user or idle time. This is how we record the cputime
      statistics.
      
      But when the tick is stopped from the idle task, we still need
      to record the number of jiffies spent tickless until we restart
      the tick and fall back to traditional tick-based cputime accounting.
      
      To do this, we take a snapshot of jiffies when the tick is stopped
      and compute the difference against the new value of jiffies when
      the tick is restarted. Then we account this whole difference to
      the idle cputime.
      
      However we are preparing to be able to stop the tick from other places
      than idle. So this idle time accounting needs to be performed from
      the callers of nohz APIs, not from the nohz APIs themselves because
      we now want them to be agnostic against places that stop/restart tick.
      
      Therefore, we pull the tickless idle time accounting out of generic
      nohz helpers up to idle entry/exit callers.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Alessio Igor Bogani <abogani@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Avi Kivity <avi@redhat.com>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Geoff Levand <geoff@infradead.org>
      Cc: Gilad Ben Yossef <gilad@benyossef.com>
      Cc: Hakan Akkan <hakanakkan@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Kevin Hilman <khilman@ti.com>
      Cc: Max Krasnyansky <maxk@qualcomm.com>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephen Hemminger <shemminger@vyatta.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      2ac0d98f
    • F
      nohz: Separate idle sleeping time accounting from nohz logic · 19f5f736
      Frederic Weisbecker 提交于
      As we plan to be able to stop the tick outside the idle task, we
      need to prepare for separating nohz logic from idle. As a start,
      this pulls the idle sleeping time accounting out of the tick
      stop/restart API to the callers on idle entry/exit.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Alessio Igor Bogani <abogani@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Avi Kivity <avi@redhat.com>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Geoff Levand <geoff@infradead.org>
      Cc: Gilad Ben Yossef <gilad@benyossef.com>
      Cc: Hakan Akkan <hakanakkan@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Kevin Hilman <khilman@ti.com>
      Cc: Max Krasnyansky <maxk@qualcomm.com>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephen Hemminger <shemminger@vyatta.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      19f5f736
  5. 07 6月, 2012 1 次提交
    • P
      rcu: Precompute RCU_FAST_NO_HZ timer offsets · aa9b1630
      Paul E. McKenney 提交于
      When a CPU is entering dyntick-idle mode, tick_nohz_stop_sched_tick()
      calls rcu_needs_cpu() see if RCU needs that CPU, and, if not, computes the
      next wakeup time based on the timer wheels.  Only later, when actually
      entering the idle loop, rcu_prepare_for_idle() will be invoked.  In some
      cases, rcu_prepare_for_idle() will post timers to wake the CPU back up.
      But all for naught: The next wakeup time for the CPU has already been
      computed, and posting a timer afterwards does not force that wakeup
      time to be recomputed.  This means that rcu_prepare_for_idle()'s have
      no effect.
      
      This is not a problem on a busy system because something else will wake
      up the CPU soon enough.  However, on lightly loaded systems, the CPU
      might stay asleep for a considerable length of time.  If that CPU has
      a callback that the rest of the system is waiting on, the system might
      run very slowly or (in theory) even hang.
      
      This commit avoids this problem by having rcu_needs_cpu() give
      tick_nohz_stop_sched_tick() an estimate of when RCU will need the CPU
      to wake back up, which tick_nohz_stop_sched_tick() takes into account
      when programming the CPU's wakeup time.  An alternative approach is
      for rcu_prepare_for_idle() to use hrtimers instead of normal timers,
      but timers are much more efficient than are hrtimers for frequently
      and repeatedly posting and cancelling a given timer, which is exactly
      what RCU_FAST_NO_HZ does.
      Reported-by: NPascal Chapperon <pascal.chapperon@wanadoo.fr>
      Reported-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NPaul E. McKenney <paul.mckenney@linaro.org>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Tested-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Tested-by: NPascal Chapperon <pascal.chapperon@wanadoo.fr>
      aa9b1630
  6. 05 6月, 2012 1 次提交
  7. 30 5月, 2012 1 次提交
  8. 25 5月, 2012 3 次提交
  9. 22 5月, 2012 4 次提交
  10. 21 5月, 2012 1 次提交
  11. 21 4月, 2012 1 次提交
  12. 20 4月, 2012 2 次提交
    • S
      tick: Fix the spurious broadcast timer ticks after resume · a6371f80
      Suresh Siddha 提交于
      During resume, tick_resume_broadcast() programs the broadcast timer in
      oneshot mode unconditionally. On the platforms where broadcast timer
      is not really required, this will generate spurious broadcast timer
      ticks upon resume. For example, on the always running apic timer
      platforms with HPET, I see spurious hpet tick once every ~5minutes
      (which is the 32-bit hpet counter wraparound time).
      
      Similar to boot time, during resume make the oneshot mode setting of
      the broadcast clock event device conditional on the state of active
      broadcast users.
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Tested-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Tested-by: svenjoac@gmx.de
      Cc: torvalds@linux-foundation.org
      Cc: rjw@sisk.pl
      Link: http://lkml.kernel.org/r/1334802459.28674.209.camel@sbsiddha-desk.sc.intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      a6371f80
    • T
      tick: Ensure that the broadcast device is initialized · b9a6a235
      Thomas Gleixner 提交于
      Santosh found another trap when we avoid to initialize the broadcast
      device in the switch_to_oneshot code. The broadcast device might be
      still in SHUTDOWN state when we actually need to use it. That
      obviously breaks, as set_next_event() is called on a shutdown
      device. This did not break on x86, but Suresh analyzed it:
      
      From the review, most likely on Sven's system we are force enabling
      the hpet using the pci quirk's method very late. And in this case,
      hpet_clockevent (which will be global_clock_event) handler can be
      null, specifically as this platform might not be using deeper c-states
      and using the reliable APIC timer.
      
      Prior to commit 'fa4da365', that handler will be set to
      'tick_handle_oneshot_broadcast' when we switch the broadcast timer to
      oneshot mode, even though we don't use it. Post commit
      'fa4da365', we stopped switching the broadcast mode to oneshot
      as this is not really needed and his platform's global_clock_event's
      handler will remain null. While on my SNB laptop, same is set to
      'clockevents_handle_noop' because hpet gets enabled very early. (noop
      handler on my platform set when the early enabled hpet timer gets
      replaced by the lapic timer).
      
      But the commit 'fa4da365' tracked the broadcast timer mode in
      the SW as oneshot, even though it didn't touch the HW timer. During
      resume however, tick_resume_broadcast() saw the SW broadcast mode as
      oneshot and actually programmed the broadcast device also into oneshot
      mode. So this triggered the null pointer de-reference after the hpet
      wraps around and depending on what the hpet counter is set to. On the
      normal platforms where hpet gets enabled early we should be seeing a
      spurious interrupt (in my SNB laptop I see one spurious interrupt
      after around 5 minutes ;) which is 32-bit hpet counter wraparound
      time), but that's a separate issue.
      
      Enforce the mode setting when trying to set an event.
      Reported-and-tested-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Cc: torvalds@linux-foundation.org
      Cc: svenjoac@gmx.de
      Cc: rjw@sisk.pl
      Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1204181723350.2542@ionos
      b9a6a235
  13. 18 4月, 2012 1 次提交
    • T
      tick: Fix oneshot broadcast setup really · b435092f
      Thomas Gleixner 提交于
      Sven Joachim reported, that suspend/resume on rc3 trips over a NULL
      pointer dereference. Linus spotted the clockevent handler being NULL.
      
      commit fa4da365(clockevents: tTack broadcast device mode change in
      tick_broadcast_switch_to_oneshot()) tried to fix a problem with the
      broadcast device setup, which was introduced in commit 77b0d60c(
      clockevents: Leave the broadcast device in shutdown mode when not
      needed).
      
      The initial commit avoided to set up the broadcast device when no
      broadcast request bits were set, but that left the broadcast device
      disfunctional. In consequence deep idle states which need the
      broadcast device were not woken up.
      
      commit fa4da365 tried to fix that by initializing the state of the
      broadcast facility, but that missed the fact, that nothing initializes
      the event handler and some other state of the underlying clock event
      device.
      
      The fix is to revert both commits and make only the mode setting of
      the clock event device conditional on the state of active broadcast
      users. 
      
      That initializes everything except the low level device mode, but this
      happens when the broadcast functionality is invoked by deep idle.
      Reported-and-tested-by: NSven Joachim <svenjoac@gmx.de>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Rafael J. Wysocki <rjw@sisk.pl>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Suresh Siddha <suresh.b.siddha@intel.com>
      Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1204181205540.2542@ionos
      b435092f
  14. 10 4月, 2012 1 次提交
  15. 06 4月, 2012 1 次提交
    • N
      nohz: Fix stale jiffies update in tick_nohz_restart() · 6f103929
      Neal Cardwell 提交于
      Fix tick_nohz_restart() to not use a stale ktime_t "now" value when
      calling tick_do_update_jiffies64(now).
      
      If we reach this point in the loop it means that we crossed a tick
      boundary since we grabbed the "now" timestamp, so at this point "now"
      refers to a time in the old jiffy, so using the old value for "now" is
      incorrect, and is likely to give us a stale jiffies value.
      
      In particular, the first time through the loop the
      tick_do_update_jiffies64(now) call is always a no-op, since the
      caller, tick_nohz_restart_sched_tick(), will have already called
      tick_do_update_jiffies64(now) with that "now" value.
      
      Note that tick_nohz_stop_sched_tick() already uses the correct
      approach: when we notice we cross a jiffy boundary, grab a new
      timestamp with ktime_get(), and *then* update jiffies.
      Signed-off-by: NNeal Cardwell <ncardwell@google.com>
      Cc: Ben Segall <bsegall@google.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: stable@vger.kernel.org
      Link: http://lkml.kernel.org/r/1332875377-23014-1-git-send-email-ncardwell@google.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      6f103929
  16. 31 3月, 2012 1 次提交
  17. 24 3月, 2012 5 次提交
  18. 23 3月, 2012 1 次提交
    • J
      ntp: Fix leap-second hrtimer livelock · 6b43ae8a
      John Stultz 提交于
      Since commit 7dffa3c6 the ntp
      subsystem has used an hrtimer for triggering the leapsecond
      adjustment. However, this can cause a potential livelock.
      
      Thomas diagnosed this as the following pattern:
      CPU 0                                                    CPU 1
      do_adjtimex()
        spin_lock_irq(&ntp_lock);
          process_adjtimex_modes();				 timer_interrupt()
            process_adj_status();                                do_timer()
              ntp_start_leap_timer();                             write_lock(&xtime_lock);
                hrtimer_start();                                  update_wall_time();
                   hrtimer_reprogram();                            ntp_tick_length()
                     tick_program_event()                            spin_lock(&ntp_lock);
                       clockevents_program_event()
      		   ktime_get()
                           seq = req_seqbegin(xtime_lock);
      
      This patch tries to avoid the problem by reverting back to not using
      an hrtimer to inject leapseconds, and instead we handle the leapsecond
      processing in the second_overflow() function.
      
      The downside to this change is that on systems that support highres
      timers, the leap second processing will occur on a HZ tick boundary,
      (ie: ~1-10ms, depending on HZ)  after the leap second instead of
      possibly sooner (~34us in my tests w/ x86_64 lapic).
      
      This patch applies on top of tip/timers/core.
      
      CC: Sasha Levin <levinsasha928@gmail.com>
      CC: Thomas Gleixner <tglx@linutronix.de>
      Reported-by: NSasha Levin <levinsasha928@gmail.com>
      Diagnoised-by: NThomas Gleixner <tglx@linutronix.de>
      Tested-by: NSasha Levin <levinsasha928@gmail.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      6b43ae8a
  19. 16 3月, 2012 1 次提交
    • J
      time: Fix change_clocksource locking · f695cf94
      John Stultz 提交于
      change_clocksource() fails to grab locks or call timekeeping_update(),
      which leaves a race window for time inconsistencies.
      
      This adds proper locking and a call to timekeeping_update() to fix this.
      
      CC: Andy Lutomirski <luto@amacapital.net>
      CC: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      f695cf94