lkml.org 
[lkml]   [2005]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] sched: consider migration thread with smp nice
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
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);
}
\
 
 \ /
  Last update: 2005-06-28 02:47    [W:0.052 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site