* Confused about CLOCK_TICK_RATE
@ 2009-03-12 19:01 Timur Tabi
2009-03-18 18:34 ` Scott Wood
2009-03-19 2:48 ` Paul Mackerras
0 siblings, 2 replies; 3+ messages in thread
From: Timur Tabi @ 2009-03-12 19:01 UTC (permalink / raw)
To: linuxppc-dev
Can someone explain CLOCK_TICK_RATE to me? It's defined in
arch/powerpc/include/asm/timex.h as such:
#define CLOCK_TICK_RATE 1024000 /* Underlying HZ */
Every architecture defines this, but some use the better comment
"Underlying frequency of the HZ timer".
My question is: why is this a constant? Shouldn't it be a variable,
perhaps something that is based on tb_ticks_per_usec?
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Confused about CLOCK_TICK_RATE
2009-03-12 19:01 Confused about CLOCK_TICK_RATE Timur Tabi
@ 2009-03-18 18:34 ` Scott Wood
2009-03-19 2:48 ` Paul Mackerras
1 sibling, 0 replies; 3+ messages in thread
From: Scott Wood @ 2009-03-18 18:34 UTC (permalink / raw)
To: Timur Tabi; +Cc: linuxppc-dev
On Thu, Mar 12, 2009 at 02:01:00PM -0500, Timur Tabi wrote:
> Can someone explain CLOCK_TICK_RATE to me? It's defined in
> arch/powerpc/include/asm/timex.h as such:
>
> #define CLOCK_TICK_RATE 1024000 /* Underlying HZ */
>
> Every architecture defines this, but some use the better comment
> "Underlying frequency of the HZ timer".
>
> My question is: why is this a constant? Shouldn't it be a variable,
> perhaps something that is based on tb_ticks_per_usec?
Looks like legacy crud, originally meant to be the PIT input frequency, that
isn't used for much on powerpc. It was probably chosen so as to make HZ ==
ACTHZ for the supported values of HZ.
-Scott
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Confused about CLOCK_TICK_RATE
2009-03-12 19:01 Confused about CLOCK_TICK_RATE Timur Tabi
2009-03-18 18:34 ` Scott Wood
@ 2009-03-19 2:48 ` Paul Mackerras
1 sibling, 0 replies; 3+ messages in thread
From: Paul Mackerras @ 2009-03-19 2:48 UTC (permalink / raw)
To: Timur Tabi; +Cc: linuxppc-dev
Timur Tabi writes:
> Can someone explain CLOCK_TICK_RATE to me? It's defined in
> arch/powerpc/include/asm/timex.h as such:
>
> #define CLOCK_TICK_RATE 1024000 /* Underlying HZ */
>
> Every architecture defines this, but some use the better comment
> "Underlying frequency of the HZ timer".
>
> My question is: why is this a constant? Shouldn't it be a variable,
> perhaps something that is based on tb_ticks_per_usec?
It's used essentially for making small adjustments to ACTHZ and
TICK_NSEC in include/linux/jiffies.h. The value was chosen so that
ACTHZ == HZ and TICK_NSEC = 1e9 for all common HZ values, since we
can't say at compile time what the decrementer frequency will be.
I believe it's all pretty moot since we changed over to using the
generic time framework anyway.
Paul.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-03-19 2:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-12 19:01 Confused about CLOCK_TICK_RATE Timur Tabi
2009-03-18 18:34 ` Scott Wood
2009-03-19 2:48 ` Paul Mackerras
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.