Skip to content

Commit

Permalink
[PATCH] sched: consider migration thread with smp nice
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Con Kolivas authored and Linus Torvalds committed Nov 9, 2005
1 parent 6dd4a85 commit ede3d0f
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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.
Expand Down

0 comments on commit ede3d0f

Please sign in to comment.