Re: [PATCH] Re: boot time, process start time, and NOW time

From: George Anzinger
Date: Thu Sep 02 2004 - 16:09:41 EST


OGAWA Hirofumi wrote:
Tim Schmielau <tim@xxxxxxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxx
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/