lkml.org 
[lkml]   [2002]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] [sched] load-balancer improvements, 2.5.3-pre5

> static void smp_tune_scheduling (void)
> {
> @@ -957,9 +959,13 @@
> cacheflush_time = (cpu_khz>>10) * (cachesize<<10) / bandwidth;
> }
>
> + cache_decay_ticks = (long)cacheflush_time/cpu_khz * HZ / 1000;
> +
> printk("per-CPU timeslice cutoff: %ld.%02ld usecs.\n",
> (long)cacheflush_time/(cpu_khz/1000),
> ((long)cacheflush_time*100/(cpu_khz/1000)) % 100);
> + printk("task migration cache decay timeout: %ld msecs.\n",
> + (cache_decay_ticks + 1) * 1000 / HZ);
> }

Isnt it better for such randomly(?) choosen numbers like 1000 and 100
which you use to divide / modulo to choose them as a near power of two?
Like 1024 for / 1000 and 128 for the */% 100 above? For correctness just
change cpu_khz to be 1024*hz, not 1000*hz.

Richard.

--
Richard Guenther <richard.guenther@uni-tuebingen.de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/
The GLAME Project: http://www.glame.de/

-
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:15    [W:0.045 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site