All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] migration cost tune up in sparc smp
@ 2006-06-05  7:21 Krzysztof Helt
  2006-06-11  1:11 ` David Miller
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Krzysztof Helt @ 2006-06-05  7:21 UTC (permalink / raw)
  To: sparclinux

[-- Attachment #1: Type: text/plain, Size: 965 bytes --]

This patch sets the max_cache_size value required to tune up
scheduler in SMP systems. Otherwise, the calculated
migration_cost is too high and task scheduling may lock up.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
---

This patch is for 2.6.17-rc5 kernel. This patch helps with Bob
Breuer's patch. Default cache size (20MB) leads to calculation of
the migration cost 20000 (20msecs).  The calculated cost of
migration is 4000 (4msecs) on dual SM81 with the patch.

The same trick is used with setting up max_cache_size  on i386
architecture. I assume the value should be set to on sparc64 as
well to correctly tune up the scheduler. 

Regards,
Krzysztof

----------------------------------------------------
Nowe serie superksiążek o Czarodziejkach WITCH!
Poznaj świat bohaterek WITCH! 
Will, Irma, Taranee, Cornelia i Hay-Lin zapraszają do księgarni.
http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fwitch.html&sid=781

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sparc32-migration-cost.patch --]
[-- Type: text/x-patch; name="sparc32-migration-cost.patch", Size: 948 bytes --]

diff -urp linux-2.6.16/arch/sparc/kernel/smp.c linux-2.6.17/arch/sparc/kernel/smp.c
--- linux-2.6.16/arch/sparc/kernel/smp.c	2006-06-05 08:56:06.000000000 +0200
+++ linux-2.6.17/arch/sparc/kernel/smp.c	2006-06-05 09:15:28.000000000 +0200
@@ -69,6 +69,17 @@ void __init smp_store_cpu_info(int id)
 						     "clock-frequency", 0);
 	cpu_data(id).prom_node = cpu_node;
 	cpu_data(id).mid = cpu_get_hwmid(cpu_node);
+
+	/* this is required to tune the scheduler correctly */
+	/* is it possible to have CPUs with different cache sizes? */
+	if (id == boot_cpu_id) {
+		int cache_line,cache_nlines;
+		cache_line = 0x20;
+		cache_line = prom_getintdefault(cpu_node, "ecache-line-size", cache_line);
+		cache_nlines = 0x8000;
+		cache_nlines = prom_getintdefault(cpu_node, "ecache-nlines", cache_nlines);
+		max_cache_size = cache_line * cache_nlines;
+	}
 	if (cpu_data(id).mid < 0)
 		panic("No MID found for CPU%d at node 0x%08d", id, cpu_node);
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-06-12  3:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-05  7:21 [PATCH] migration cost tune up in sparc smp Krzysztof Helt
2006-06-11  1:11 ` David Miller
2006-06-12  1:21 ` Bob Breuer
2006-06-12  3:54 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.