[PATCH] cacheflushtime

Rik van Riel riel en nl.linux.org
Lun Ene 31 22:17:44 CST 2000


Hi Linus,

taking the hint from someone who's name I'm too lazy to
lookup in my mailfolder (sorry), I've decided to take it
on me to create this small patch against 2.3.41 that
fixes the cacheflushtime calculation.

Linus, could you please apply this patch for the next
version?

regards,

Rik
--
The Internet is not a network of computers. It is a network
of people. That is its real strength.


--- linux-2.3.41/arch/i386/kernel/smpboot.c.orig	Mon Jan 31 15:43:02 2000
+++ linux-2.3.41/arch/i386/kernel/smpboot.c	Mon Jan 31 15:53:00 2000
@@ -710,7 +710,8 @@
 
 static void smp_tune_scheduling (void)
 {
-	unsigned long cachesize;
+	unsigned long cachesize;       /* kB   */
+	unsigned long bandwidth = 350; /* MB/s */
 	/*
 	 * Rough estimation for SMP scheduling, this is the number of
 	 * cycles it takes for a fully memory-limited process to flush
@@ -731,10 +732,12 @@
 		return;
 	} else {
 		cachesize = boot_cpu_data.x86_cache_size;
-		if (cachesize == -1)
-			cachesize = 8; /* Pentiums */
+		if (cachesize == -1) {
+			cachesize = 16; /* Pentiums, 2x8kB cache */
+			bandwidth = 100;
+		}
 
-		cacheflush_time = cpu_hz/1024*cachesize/5000;
+		cacheflush_time = (cpu_hz>>20) * (cachesize<<10) / bandwidth;
 	}
 
 	printk("per-CPU timeslice cutoff: %ld.%02ld usecs.\n",


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo en vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



Más información sobre la lista de distribución Ayuda