lkml.org 
[lkml]   [2003]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Increasing HZ (patch for HZ > 1000)
Hi!

> Just one more thing about the patch I sent. I think it addresses
> something unclean in the bogomips computation. For example, in
> arch/i386/kernel/cpu/proc.c, you have:
>
> seq_printf(m, "\nbogomips\t: %lu.%02lu\n\n",
> c->loops_per_jiffy/(500000/HZ),
> (c->loops_per_jiffy/(5000/HZ)) % 100);
>
> It's clear that for any case where 5000/HZ is not an integer, the
> bogomips decimals will be wrong and if 500000/HZ isn't an integer, the
> bogomips integer part will be wrong.
>
> For example on a 2 GHz processor with a 4000 bogomips value and HZ=1200,
> the code above will produce 3996.66 instead of 4000. Of course, as soon
> as HZ goes above 5000, you have a divide by zero right at compile time.

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.
Pavel

--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:59    [W:0.106 / U:0.736 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site