Messages in this thread | | | Subject | Re: Increasing HZ (patch for HZ > 1000) | From | Jean-Marc Valin <> | Date | Fri, 12 Dec 2003 17:50:30 -0500 |
| |
> 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 [unhandled content-type:application/pgp-signature] | |