Re: [RFC][PATCH] new timeofday core subsystem (v.A0)

From: john stultz (johnstul_at_us.ibm.com)
Date: 09/09/04

  • Next message: Zwane Mwaikambo: "RE: [ACPI] Re: [PATCH] Oops and panic while unloading holder of pm_idle"
    To: george anzinger <george@mvista.com>
    Date:	Wed, 08 Sep 2004 17:51:59 -0700
    
    

    On Wed, 2004-09-08 at 17:08, George Anzinger wrote:
    > john stultz wrote:
    > > On Fri, 2004-09-03 at 17:02, George Anzinger wrote:
    > >
    > >>>Again, monotonic_clock() and friends are NTP adjusted, so drift caused
    > >>>by inaccurate calibration shouldn't be a problem the interval timer code
    > >>>should need to worry about (outside of maybe adjusting its interval time
    > >>>if its always arriving late/early). If possible the timesource
    > >>>calibration code should be improved, but that's icing on the cake and
    > >>>isn't critical.
    > >>>
    > >>
    > >>Are you providing a way to predict what clock count provide a given time offset
    > >>INCLUDING ntp? If so, cool. If not we need to get this conversion right. We
    > >>will go into this more on your return.
    > >
    > >
    > > Sorry, I'm not sure what you mean. Mind expanding on the idea while my
    > > brain warms back up?
    >
    > The issue is this: A user wants a timer to fire at exactly time B which is
    > several hours later than now (time A). We need to know how to measure this time
    > with the timer resources (not the clock as you are talking about it). Currently
    > we do something like delta_jiffies = timespec_to_jiffies(B - A) and set up a
    > jiffies timer to expire in delta_jiffies. At this time we "assume" in
    > timespec_to_jiffies() that we _know_ how long a jiffie is in terms of wall clock
    > nanoseconds. We also assume (possibly incorrectly) that this number is "good
    > enough" even with ntp messing things up. I think this means that we assume
    > that, on the average, we have the right conversion and that any drift will be a)
    > small and b) on the average 0 (or real close to it).

    Why must we use jiffies to tell when a timer expires? Honestly I'd like
    to see xtime and jiffies both disappear, but I'm not very familiar w/
    the soft-timer code, so forgive me if I'm misunderstanding.

    So instead of calculating delta_jiffies, just mark the timer to expire
    at B. Then each interrupt, you use get_fast_timestamp() to decide if now
    is greater then B. If so, expire it.

    Then we can look at being able to program timer interrupts to occur as
    close as possible to the next soft-timer's expiration time.

    -john

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Zwane Mwaikambo: "RE: [ACPI] Re: [PATCH] Oops and panic while unloading holder of pm_idle"

    Relevant Pages

    • [PATCH 11/13] hrtimer: turn hrtimers into range timers
      ... Subject: hrtimer: turn hrtimers into range timers ... this patch turns hrtimers into range timers; they have 2 expire points ... expire point, the kernel now has the freedom to fire this timer at this point, ... the current task state has been set ). ...
      (Linux-Kernel)
    • Re: Help with the high res timers
      ... >> multiple bucket entries would be expired. ... For a HR timer, we need to know ... > HR timer code to take care of the nanosecond remainder. ... > timer for jiffie X will expire prior to a high res timer for jiffie X + Y ...
      (Linux-Kernel)
    • Re: [patch 00/21] hrtimer - High-resolution timer subsystem
      ... >> access to the first expiring timer without walking the rb_tree. ... I have already removed the list_head for the non high resolution ... > really did only expire once. ...
      (Linux-Kernel)
    • Re: Tesing of / bugs in new timerfd API
      ... I found what looks like a bug (see ... CLOCK_REALTIME clock to expire in the past, ... (Nor is it consistent with the behavior of POSIX timers. ... Suppose that we set an absolute timer to expire 100 seconds ...
      (Linux-Kernel)
    • Re: [PATCH 1/1] driver: Tpm hardware enablement
      ... I don't see a problem with changing the schedule to an msleep. ... Also the timer handling looks suspect... ... expire and since the function that the timer calls on expiration does ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)

    Loading