lkml.org 
[lkml]   [2012]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 33/36] AArch64: Generic timers support
On 07/12/2012 03:56 AM, Linus Walleij wrote:
> On Thu, Jul 12, 2012 at 12:09 PM, Marc Zyngier <marc.zyngier@arm.com> wrote:
>
>> On Thu, 12 Jul 2012 02:18:42 +0200, Linus Walleij
>> <linus.ml.walleij@gmail.com> wrote:
>>
>> Hi Linus,
>>
>>> I'm reviewing the only patch I really understand...
>>>
>>> 2012/7/6 Catalin Marinas <catalin.marinas@arm.com>:
>>>
>>>> +/* This isn't really used any more */
>>>> +#define CLOCK_TICK_RATE 1000
>>> Is it still necessary to even have it there?
>> It is used as part of the LATCH/TICK_* computation in
>> include/linux/jiffies.h. It seems that any value could do, actually, and it
>> only seem to be used in kernel/time/ntp.c. Any guidance on this much
>> appreciated.
>>
>> By the way, there is a very interesting comment about this in
>> arch/ia64/include/asm/timex.h.
> Hmmmm paging John Stultz, TGLX, Deepak Saxena who have been in
> this area...

Yea, its definitely crufty, but CLOCK_TICK_RATE is still important if
you use the jiffies clocksource (usually in the case of hardware that
does not support clocksources).

Basically its just trying to handle the cases where the time interval
1sec/HZ (for the various values of HZ) can not be accurately computed
due to the granularity of the tick device. In those cases we use
CLOCK_TICK_RATE to figure out the granularity error and modify the
length of a jiffie, just slightly, so it matches the hardware.

Most architectures have some sort of copy-pasted version of i386's
CLOCK_TICK_RATE (although I guess its possible some non-x86 systems
might actually have an 8253 or similar timer) and since the move to
GENERIC_TIME and clocksources, any incorrectly calculated error has very
little effect on most hardware since its not used to track time.

So following ia64's method is probably better then copying the 8253's
rate if you're not concerned about tick-granularity error.

thanks
-john




\
 
 \ /
  Last update: 2012-07-12 19:41    [W:0.251 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site