Re: [PATCH] Staircase scheduler v7.4

From: Con Kolivas
Date: Sun Jun 27 2004 - 05:29:00 EST



Ok I found a problem which alost certainly is responsible in the
conversion from nanoseconds to Hz and may if you're unlucky give a blank
timeslice. Can you try this (against staircase7.4). I'm almost certain
it's responsbile.

Cheers,
Con

P.S.
Sorry about all sorts of different ways I'm sending
attachments. I'm away from home and use any email access I can find.--- linux-2.6.7-staircase7.4/kernel/sched.c 2004-06-27 20:13:52.990516660 +1000
+++ linux-2.6.7-staircase7.4-2/kernel/sched.c 2004-06-27 20:17:21.849580653 +1000
@@ -218,8 +218,8 @@ static void dequeue_task(struct task_str

static void enqueue_task(struct task_struct *p, runqueue_t *rq)
{
- if (rq->curr->flags & PF_PREEMPTED) {
- rq->curr->flags &= ~PF_PREEMPTED;
+ if (p->flags & PF_PREEMPTED) {
+ p->flags &= ~PF_PREEMPTED;
list_add(&p->run_list, rq->queue + p->prio);
} else
list_add_tail(&p->run_list, rq->queue + p->prio);
@@ -330,7 +330,7 @@ static void recalc_task_prio(task_t *p,
{
unsigned long sleep_time = now - p->timestamp;
unsigned long run_time = NS_TO_JIFFIES(p->runtime);
- unsigned long total_run = NS_TO_JIFFIES(p->totalrun) + run_time;
+ unsigned long total_run = NS_TO_JIFFIES(p->totalrun + p->runtime);
if ((!run_time && NS_TO_JIFFIES(p->runtime + sleep_time) <
RR_INTERVAL) || p->flags & PF_FORKED) {
p->flags &= ~PF_FORKED;