Re: testing/pre-7 and do_poll()

Linus Torvalds
1999-01-11T07:03:33Z

On Mon, 11 Jan 1999, Chip Salzenberg wrote:
> >
> > Hint: HZ is a define - not 100.
> > You just ended up dividing by zero on certain architectures.
>
> I didn't think HZ ranged over 1000 in practice, else of course I would
> not have written the above.

I made the same assumption wrt usecs (notice how I myself would divide by
zero on any architecture where HZ is over 1000000).

Right now, HZ is 100 on most architectures, with alpha being the exception
at 1024. Some of the PC speaker patches used to have HZ at 8192 even on a
PC, although later versions scaled it down (and just internally used a
timer tick happening at 8kHz, leaving HZ at 100).

With modern machines, 100Hz is just peanuts, and a HZ in the kilohertz
certainly makes sense - and allows for nicer granularity for a lot of
things. So far, megahertz are still far in the future, but maybe I some
day will have to remove even that assumption. Unlikely to be a problem in
my lifetime, but hey, I can hope (whether due to a long life or really
fast CPU's, I don't care ;)

Linus