All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Williams <pwil3058@bigpond.net.au>
To: Con Kolivas <kernel@kolivas.org>
Cc: linux kernel mailing list <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>, Ingo Molnar <mingo@elte.hu>,
	"Martin J. Bligh" <mbligh@aracnet.com>
Subject: Re: [PATCH] sched: consider migration thread with smp nice
Date: Tue, 28 Jun 2005 10:43:29 +1000	[thread overview]
Message-ID: <42C09D31.5030207@bigpond.net.au> (raw)
In-Reply-To: <200506261825.19740.kernel@kolivas.org>

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

Con Kolivas wrote:
> This patch improves throughput with the smp nice balancing code. Many thanks 
> to Martin Bligh for the usage of his regression testing bed to confirm the 
> effectiveness of various patches.

Con,
	This doesn't build on non SMP systems due to the migration_thread field 
only being defined for SMP.  Attached is a copy of a slightly modified 
PlugSched version of the patch which I used to fix the problem in 
PlugSched.  Even though it's for a different file it should be easy to 
copy over.

Peter
-- 
Peter Williams                                   pwil3058@bigpond.net.au

"Learning, n. The kind of ignorance distinguishing the studious."
  -- Ambrose Bierce

[-- Attachment #2: migration_thread.diff --]
[-- Type: text/x-diff, Size: 1458 bytes --]

Index: MM-2.6.12/include/linux/sched_pvt.h
===================================================================
--- MM-2.6.12.orig/include/linux/sched_pvt.h	2005-06-28 10:11:47.000000000 +1000
+++ MM-2.6.12/include/linux/sched_pvt.h	2005-06-28 10:37:14.000000000 +1000
@@ -393,6 +393,11 @@
 {
 	rq->prio_bias -= MAX_STATIC_PRIO - prio;
 }
+
+static inline int is_migration_thread(const task_t *p, const runqueue_t *rq)
+{
+	return p == rq->migration_thread;
+}
 #else
 static inline void inc_prio_bias(runqueue_t *rq, int prio)
 {
@@ -401,23 +406,35 @@
 static inline void dec_prio_bias(runqueue_t *rq, int prio)
 {
 }
+
+static inline int is_migration_thread(const task_t *p, const runqueue_t *rq)
+{
+	return 0;
+}
 #endif
 
 static inline void inc_nr_running(task_t *p, runqueue_t *rq)
 {
 	rq->nr_running++;
-	if (rt_task(p))
-		inc_prio_bias(rq, p->prio);
-	else
+	if (rt_task(p)) {
+		if (!is_migration_thread(p, rq))
+			/*
+			 * The migration thread does the actual balancing. Do
+			 * not bias by its priority as the ultra high priority
+			 * will skew balancing adversely.
+			 */
+			inc_prio_bias(rq, p->prio);
+	} else
 		inc_prio_bias(rq, p->static_prio);
 }
 
 static inline void dec_nr_running(task_t *p, runqueue_t *rq)
 {
 	rq->nr_running--;
-	if (rt_task(p))
-		dec_prio_bias(rq, p->prio);
-	else
+	if (rt_task(p)) {
+		if (!is_migration_thread(p, rq))
+			dec_prio_bias(rq, p->prio);
+	} else
 		dec_prio_bias(rq, p->static_prio);
 }
 

  reply	other threads:[~2005-06-28  0:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-26  8:25 [PATCH] sched: consider migration thread with smp nice Con Kolivas
2005-06-28  0:43 ` Peter Williams [this message]
2005-06-28  0:48   ` Con Kolivas
2005-06-28  2:30     ` Peter Williams
  -- strict thread matches above, loose matches on Subject: below --
2005-07-01 11:40 2.6.13-rc1-mm1 Andrew Morton
2005-07-02  0:22 ` [PATCH] sched: consider migration thread with smp nice Con Kolivas

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=42C09D31.5030207@bigpond.net.au \
    --to=pwil3058@bigpond.net.au \
    --cc=akpm@osdl.org \
    --cc=kernel@kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@aracnet.com \
    --cc=mingo@elte.hu \
    /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.