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

Richard Guenther (rguenth@tat.physik.uni-tuebingen.de)
Mon, 28 Jan 2002 16:22:56 +0100 (CET)


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