lkml.org 
[lkml]   [2003]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] sched-rebalance-fix-2.5.69-A1

the attached patch fixes a race noticed by Mike Galbraith: the scheduler
can lose a rebalance tick if some task happens to not be rescheduled in
time. This is not a fatal condition, but an inconsistency nevertheless.

Ingo

--- linux/kernel/sched.c.orig
+++ linux/kernel/sched.c
@@ -1180,7 +1180,7 @@ void scheduler_tick(int user_ticks, int
/* Task might have expired already, but not scheduled off yet */
if (p->array != rq->active) {
set_tsk_need_resched(p);
- return;
+ goto out;
}
spin_lock(&rq->lock);
/*
@@ -1207,7 +1207,7 @@ void scheduler_tick(int user_ticks, int
dequeue_task(p, rq->active);
enqueue_task(p, rq->active);
}
- goto out;
+ goto out_unlock;
}
if (!--p->time_slice) {
dequeue_task(p, rq->active);
@@ -1223,8 +1223,9 @@ void scheduler_tick(int user_ticks, int
} else
enqueue_task(p, rq->active);
}
-out:
+out_unlock:
spin_unlock(&rq->lock);
+out:
rebalance_tick(rq, 0);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.028 / U:2.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site