1. 21 Aug, 2008 5 commits
    • John Stultz's avatar
      clocksource: introduce CLOCK_MONOTONIC_RAW · 2d42244a
      John Stultz authored
      In talking with Josip Loncaric, and his work on clock synchronization (see
      btime.sf.net), he mentioned that for really close synchronization, it is
      useful to have access to "hardware time", that is a notion of time that is
      not in any way adjusted by the clock slewing done to keep close time sync.
      
      Part of the issue is if we are using the kernel's ntp adjusted
      representation of time in order to measure how we should correct time, we
      can run into what Paul McKenney aptly described as "Painting a road using
      the lines we're painting as the guide".
      
      I had been thinking of a similar problem, and was trying to come up with a
      way to give users access to a purely hardware based time representation
      that avoided users having to know the underlying frequency and mask values
      needed to deal with the wide variety of possible underlying hardware
      counters.
      
      My solution is to introduce CLOCK_MONOTONIC_RAW.  This exposes a
      nanosecond based time value, that increments starting at bootup and has no
      frequency adjustments made to it what so ever.
      
      The time is accessed from userspace via the posix_clock_gettime() syscall,
      passing CLOCK_MONOTONIC_RAW as the clock_id.
      Signed-off-by: default avatarJohn Stultz <johnstul@us.ibm.com>
      Signed-off-by: default avatarRoman Zippel <zippel@linux-m68k.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      2d42244a
    • Roman Zippel's avatar
      clocksource: introduce clocksource_forward_now() · 9a055117
      Roman Zippel authored
      To keep the raw monotonic patch simple first introduce
      clocksource_forward_now(), which takes care of the offset since the last
      update_wall_time() call and adds it to the clock, so there is no need
      anymore to deal with it explicitly at various places, which need to make
      significant changes to the clock.
      
      This is also gets rid of the timekeeping_suspend_nsecs, instead of
      waiting until resume, the value is accumulated during suspend. In the end
      there is only a single user of __get_nsec_offset() left, so I integrated
      it back to getnstimeofday().
      Signed-off-by: default avatarRoman Zippel <zippel@linux-m68k.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      9a055117
    • John Stultz's avatar
      clocksource: keep track of original clocksource frequency · 1aa5dfb7
      John Stultz authored
      The clocksource frequency is represented by
      clocksource->mult/2^(clocksource->shift).  Currently, when NTP makes
      adjustments to the clock frequency, they are made directly to the mult
      value.
      
      This has the drawback that once changed, we cannot know what the orignal
      mult value was, or how much adjustment has been applied.
      
      This property causes problems in calculating proper ntp intervals when
      switching back and forth between clocksources.
      
      This patch separates the current mult value into a mult and mult_orig
      pair.  The mult_orig value stays constant, while the ntp clocksource
      adjustments are done only to the mult value.
      
      This allows for correct ntp interval calculation and additionally lays the
      groundwork for a new notion of time, what I'm calling the monotonic-raw
      time, which is introduced in a following patch.
      Signed-off-by: default avatarJohn Stultz <johnstul@us.ibm.com>
      Signed-off-by: default avatarRoman Zippel <zippel@linux-m68k.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      1aa5dfb7
    • David Howells's avatar
      clocksource: check range · ee974e01
      David Howells authored
      Check that the value being passed to parse_pmtmr() does not exceed the
      limits of pmtmr_ioport.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      ee974e01
    • Linus Torvalds's avatar
      Linux v2.6.27-rc4 · 6a55617e
      Linus Torvalds authored
      6a55617e
  2. 20 Aug, 2008 35 commits