Re: Increasing HZ (patch for HZ > 1000)

Jean-Marc Valin
2003-12-12T22:50:54Z

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

> Well, on i386 we only run with HZ=100 and HZ=1000, so bug is latent,
> but if you can find nice way to rewrite it without the bug, it would
> probably be worth fixing.

Actually, the way I rewrote it in the patch is immune to that kind of
problem:

seq_printf(m, "\nbogomips\t: %lu.%02lu\n\n",
HZ*(c->loops_per_jiffy>>3)/62500,
(HZ*(c->loops_per_jiffy>>3)/625)%100);

It will work correctly for any HZ up to ~34000 bogomips (using 32-bit
arithmetic).

Jean-Marc

--
Jean-Marc Valin, M.Sc.A., ing. jr.
LABORIUS (http://www.gel.usherb.ca/laborius)
Université de Sherbrooke, Québec, Canada

[-- Attachment #2: Ceci est une partie de message numériquement signée. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]