All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Krzysztof Helt" <krzysztof.h1@wp.pl>
To: sparclinux@vger.kernel.org
Subject: [PATCH] migration cost tune up in sparc smp
Date: Mon, 05 Jun 2006 07:21:15 +0000	[thread overview]
Message-ID: <4483db6b9a343@wp.pl> (raw)

[-- 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);
 }

             reply	other threads:[~2006-06-05  7:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-05  7:21 Krzysztof Helt [this message]
2006-06-11  1:11 ` [PATCH] migration cost tune up in sparc smp David Miller
2006-06-12  1:21 ` Bob Breuer
2006-06-12  3:54 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4483db6b9a343@wp.pl \
    --to=krzysztof.h1@wp.pl \
    --cc=sparclinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.