Re: Why HZ on i386 is 100 ?

Matti Aarnio
2002-04-17T08:04:47Z

On Wed, Apr 17, 2002 at 02:01:42AM -0400, Robert Love wrote:
> On Wed, 2002-04-17 at 01:34, Linus Torvalds wrote:
> > No, it also makes it much easier to convert to/from the standard UNIX time
> > formats (ie "struct timeval" and "struct timespec") without any surprises,
> > because a jiffy is exactly representable in both if you have a HZ value
> > of 100 or 100, but not if your HZ is 1024.
>
> Exactly - this was my issue. So what _was_ the rationale behind Alpha
> picking 1024 (and others following)? More importantly, can we change to
> 1000?

Alpha processors don't have full division hardware, they have to
iterate it one bit at the time. They do have a flash multiplier,
and a barrel-shifter. Shifts take one pipeline cycle, like to
addition and substraction. Multiply takes 6-12 depending on model,
but division takes 64...

Converting the tick to gettimeofday() seconds is faster when
the tick is power of two.

> Robert Love

/Matti Aarnio