lkml.org 
[lkml]   [2004]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] Re: boot time, process start time, and NOW time
    OGAWA Hirofumi wrote:
    > Tim Schmielau <tim@physik3.uni-rostock.de> writes:
    >
    >
    >>However, the actual reason were just missing wall_to_monotonic
    >>initializations:
    >>
    >> http://www.uwsg.iu.edu/hypermail/linux/kernel/0306.2/1330.html
    >
    >
    > Sorry for may not be related question in this thread.
    >
    >
    > xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
    >
    > #include <stdio.h>
    >
    > #define HZ 1000
    > #define NSEC_PER_SEC (1000000000L)
    > #define INITIAL_JIFFIES ((unsigned long)(unsigned int) (-300*HZ))
    >
    > int main()
    > {
    > printf("%ld\n", (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ));
    > return 0;
    > }
    >
    > hirofumi@devron (a)[1006]$ ./c
    > 296000000
    >
    > xtime.tv_nsec was not 0. Is this bug?

    Well, my machine says the result should be 996000000, so something is wrong with
    your or my math. As to if the initial jiffie value should be a multiple of HZ,
    I don't see why. I think it is several counts off of this value when the system
    wall clock is set in any case.

    --
    George Anzinger george@mvista.com
    High-res-timers: http://sourceforge.net/projects/high-res-timers/
    Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml

    -
    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.021 / U:30.548 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site