Re: Is there a problem in timeval_to_jiffies?

From: Andi Kleen
Date: Wed Sep 29 2004 - 17:05:23 EST


Tim Bird <tim.bird@xxxxxxxxxxx> writes:

> Henry Margies wrote:
>> Right? But for arm, with a jiffie size of 10000000, it is much
>> more easier. And that is why I don't understand why an one second
>> interval is converted to 101 jiffies (on arm).
> ...
>> I agree. But then, why adding one jiffie to every interval? If
>> there is no latency, the timer should appear right at the
>> beginning of a jiffie. For x86 you are right, because 10 jiffies
>> are less then 10ms. But for arm, 1 jiffie is precisely 10ms.
>
> How does the computer "know" that the timer is at the beginning
> of the jiffy? By definition, Linux (without HRT support) has

do_gettimeofday() or better the posix monotonic clock normally have
much better resolution than a jiffie (on x86 typically the resolution
of the CPU clock) xtime is the T-O-D of the last jiffie
However calling do_gettimeofday and doing the calculation may
be too expensive.

-Andi

-
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/