1. 21 Aug, 2009 2 commits
    • john stultz's avatar
      time: Introduce CLOCK_REALTIME_COARSE · da15cfda
      john stultz authored
      After talking with some application writers who want very fast, but not
      fine-grained timestamps, I decided to try to implement new clock_ids
      to clock_gettime(): CLOCK_REALTIME_COARSE and CLOCK_MONOTONIC_COARSE
      which returns the time at the last tick. This is very fast as we don't
      have to access any hardware (which can be very painful if you're using
      something like the acpi_pm clocksource), and we can even use the vdso
      clock_gettime() method to avoid the syscall. The only trade off is you
      only get low-res tick grained time resolution.
      
      This isn't a new idea, I know Ingo has a patch in the -rt tree that made
      the vsyscall gettimeofday() return coarse grained time when the
      vsyscall64 sysctrl was set to 2. However this affects all applications
      on a system.
      
      With this method, applications can choose the proper speed/granularity
      trade-off for themselves.
      Signed-off-by: default avatarJohn Stultz <johnstul@us.ibm.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: nikolag@ca.ibm.com
      Cc: Darren Hart <dvhltc@us.ibm.com>
      Cc: arjan@infradead.org
      Cc: jonathan@jonmasters.org
      LKML-Reference: <1250734414.6897.5.camel@localhost.localdomain>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      da15cfda
    • Thomas Gleixner's avatar
      x86: Do not unregister PIT clocksource on PIT oneshot setup/shutdown · 8cab02dc
      Thomas Gleixner authored
      This basically reverts commit 1a0c009a (x86: unregister PIT
      clocksource when PIT is disabled) because the problem which was tried
      to address with that patch has been solved by commit 3f68535a
      (clocksource: sanity check sysfs clocksource changes).
      
      The problem addressed by the original patch is that PIT could be
      selected as clocksource after the system switched the PIT off or set
      the PIT into one shot mode which would result in complete timekeeping
      wreckage.
      
      Now with the sysfs sanity check in place PIT cannot be selected again
      when the system is in oneshot mode. The system will not switch to one
      shot mode as long as PIT is installed because PIT is not suitable for
      one shot.
      
      The shutdown case which happens when the lapic timer is installed is
      covered by the fact that init_pit_clocksource() is called after the
      lapic timer take over and then does not install the PIT clocksource
      at all.
      
      We should have done the sanity checks back then, but ...
      
      This also solves the locking problem which was reported vs. the
      clocksource rework.
      
      LKML-Reference: <new-submission>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: john stultz <johnstul@us.ibm.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      8cab02dc
  2. 19 Aug, 2009 2 commits
    • Martin Schwidefsky's avatar
      clocksource: Avoid clocksource watchdog circular locking dependency · 01548f4d
      Martin Schwidefsky authored
      stop_machine from a multithreaded workqueue is not allowed because
      of a circular locking dependency between cpu_down and the workqueue
      execution. Use a kernel thread to do the clocksource downgrade.
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: john stultz <johnstul@us.ibm.com>
      LKML-Reference: <20090818170942.3ab80c91@skybase>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      01548f4d
    • Thomas Gleixner's avatar
      clocksource: Protect the watchdog rating changes with clocksource_mutex · d0981a1b
      Thomas Gleixner authored
      Martin pointed out that commit 6ea41d2529 (clocksource: Call
      clocksource_change_rating() outside of watchdog_lock) has a
      theoretical reference count problem. The calls to
      clocksource_change_rating() are now done outside of the clocksource
      mutex and outside of the watchdog lock. A concurrent
      clocksource_unregister() could remove the clock.
      
      Split out the code which changes the rating from
      clocksource_change_rating() into __clocksource_change_rating().
      
      Protect the clocksource_watchdog_work() code sequence with the
      clocksource_mutex() and call __clocksource_change_rating().
      
      LKML-Reference: <alpine.LFD.2.00.0908171038420.2782@localhost.localdomain>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      d0981a1b
  3. 15 Aug, 2009 16 commits
  4. 14 Aug, 2009 1 commit
  5. 13 Aug, 2009 19 commits