--- linux-2.6-npiggin/kernel/sched.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff -puN kernel/sched.c~sched-nr_unint-fix kernel/sched.c --- linux-2.6/kernel/sched.c~sched-nr_unint-fix 2004-11-17 09:54:36.000000000 +1100 +++ linux-2.6-npiggin/kernel/sched.c 2004-11-17 10:01:49.000000000 +1100 @@ -981,14 +981,14 @@ static int try_to_wake_up(task_t * p, un int cpu, this_cpu, success = 0; unsigned long flags; long old_state; - runqueue_t *rq, *old_rq; + runqueue_t *rq; #ifdef CONFIG_SMP unsigned long load, this_load; struct sched_domain *sd; int new_cpu; #endif - old_rq = rq = task_rq_lock(p, &flags); + rq = task_rq_lock(p, &flags); schedstat_inc(rq, ttwu_cnt); old_state = p->state; if (!(old_state & state)) @@ -1083,7 +1083,7 @@ out_set_cpu: out_activate: #endif /* CONFIG_SMP */ if (old_state == TASK_UNINTERRUPTIBLE) { - old_rq->nr_uninterruptible--; + rq->nr_uninterruptible--; /* * Tasks on involuntary sleep don't earn * sleep_avg beyond just interactive state. @@ -1608,8 +1608,12 @@ void pull_task(runqueue_t *src_rq, prio_ { dequeue_task(p, src_array); src_rq->nr_running--; - set_task_cpu(p, this_cpu); this_rq->nr_running++; + if (p->state == TASK_UNINTERRUPTIBLE) { + src_rq->nr_uninterruptible--; + this_rq->nr_uninterruptible++; + } + set_task_cpu(p, this_cpu); enqueue_task(p, this_array); p->timestamp = (p->timestamp - src_rq->timestamp_last_tick) + this_rq->timestamp_last_tick; _