lkml.org 
[lkml]   [2004]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC] New Time of day proposal (updated 9/2/04)
    On Thu, 2 Sep 2004, john stultz wrote:

    > On Thu, 2004-09-02 at 15:09, Christoph Lameter wrote:
    > > > timeofday_hook()
    > > > now = read(); /* read the timesource */
    > > > ns = cyc2ns(now - offset_base); /* calc nsecs since last call */
    > > > ntp_ns = ntp_scale(ns); /* apply ntp scaling */
    > > > system_time += ntp_ns; /* add scaled value to system_time */
    > > > ntp_advance(ns); /* advance ntp state machine by ns */
    > > > offset_base = now; /* set new offset_base */
    > >
    > > This would only work if the precision of the timer used is
    > > <=1ns and if you are actually able to caculate the nanoseconds that have
    > > passed. What do you do if the interval is lets say 100ns and the time the
    > > timeofday hook is being called can be anytime within this 100ns interval
    > > since the time source is not always precise?
    >
    > Well, with the exception of the TSC, none of the current time sources
    > have <=1ns resolution, but I'm not sure I understand the problem you're
    > trying to point out. Could you clarify?
    >
    > > I think its unavoidable to do some correction like provided by the time
    > > interpolator if the clock source does not provide ns.
    >
    > Could you point to the specific correction you describe?

    I drop my objections. I was thinking too much in terms of the old code....
    This should work fine.
    -
    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/

    \
     
     \ /
      Last update: 2005-03-22 14:05    [W:0.020 / U:0.092 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site