summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCon Kolivas <kernel@kolivas.org>2005-11-08 21:39:00 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-09 07:56:32 -0800
commitede3d0fba99520f268067917b50858d788bc41da (patch)
tree5c33dc43c22f0c2b17db2f118156384baa35cae8
parent6dd4a85bb3ee0715415892c8b0f2a9bd08d31ca4 (diff)
downloadlinux-ede3d0fba99520f268067917b50858d788bc41da.tar.gz
linux-ede3d0fba99520f268067917b50858d788bc41da.tar.bz2
linux-ede3d0fba99520f268067917b50858d788bc41da.zip
[PATCH] sched: consider migration thread with smp nice
The intermittent scheduling of the migration thread at ultra high priority makes the smp nice handling see that runqueue as being heavily loaded. The migration thread itself actually handles the balancing so its influence on priority balancing should be ignored. Signed-off-by: Con Kolivas <kernel@kolivas.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--kernel/sched.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 502d47c883b6..0f2def822296 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -670,6 +670,31 @@ static inline void dec_prio_bias(runqueue_t *rq, int prio)
{
rq->prio_bias -= MAX_PRIO - prio;
}
+
+static inline void inc_nr_running(task_t *p, runqueue_t *rq)
+{
+ rq->nr_running++;
+ if (rt_task(p)) {
+ if (p != rq->migration_thread)
+ /*
+ * 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)) {
+ if (p != rq->migration_thread)
+ dec_prio_bias(rq, p->prio);
+ } else
+ dec_prio_bias(rq, p->static_prio);
+}
#else
static inline void inc_prio_bias(runqueue_t *rq, int prio)
{
@@ -678,25 +703,17 @@ static inline void inc_prio_bias(runqueue_t *rq, int prio)
static inline void dec_prio_bias(runqueue_t *rq, int prio)
{
}
-#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
- 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
- dec_prio_bias(rq, p->static_prio);
}
+#endif
/*
* __activate_task - move a task to the runqueue.