Re: [patch] [sched] load-balancer improvements, 2.5.3-pre5

From: Richard Guenther (rguenth@tat.physik.uni-tuebingen.de)
Date: Mon Jan 28 2002 - 10:22:56 EST


> 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/



This archive was generated by hypermail 2b29 : Thu Jan 31 2002 - 21:00:50 EST