Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3302
b: refs/heads/master
c: a3464a1
h: refs/heads/master
v: v3
  • Loading branch information
Chen Shang authored and Linus Torvalds committed Jun 25, 2005
1 parent ac90ebf commit 0d9f840
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 77391d71681d05d2f4502f91ad62618522abf624
refs/heads/master: a3464a102a69a4e00efb0a763e274ce290995b4b
19 changes: 12 additions & 7 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ static inline void __activate_idle_task(task_t *p, runqueue_t *rq)
rq->nr_running++;
}

static void recalc_task_prio(task_t *p, unsigned long long now)
static int recalc_task_prio(task_t *p, unsigned long long now)
{
/* Caller must always ensure 'now >= p->timestamp' */
unsigned long long __sleep_time = now - p->timestamp;
Expand Down Expand Up @@ -732,7 +732,7 @@ static void recalc_task_prio(task_t *p, unsigned long long now)
}
}

p->prio = effective_prio(p);
return effective_prio(p);
}

/*
Expand All @@ -755,7 +755,7 @@ static void activate_task(task_t *p, runqueue_t *rq, int local)
}
#endif

recalc_task_prio(p, now);
p->prio = recalc_task_prio(p, now);

/*
* This checks to make sure it's not an uninterruptible task
Expand Down Expand Up @@ -2751,7 +2751,7 @@ asmlinkage void __sched schedule(void)
struct list_head *queue;
unsigned long long now;
unsigned long run_time;
int cpu, idx;
int cpu, idx, new_prio;

/*
* Test if we are atomic. Since do_exit() needs to call into
Expand Down Expand Up @@ -2873,9 +2873,14 @@ asmlinkage void __sched schedule(void)
delta = delta * (ON_RUNQUEUE_WEIGHT * 128 / 100) / 128;

array = next->array;
dequeue_task(next, array);
recalc_task_prio(next, next->timestamp + delta);
enqueue_task(next, array);
new_prio = recalc_task_prio(next, next->timestamp + delta);

if (unlikely(next->prio != new_prio)) {
dequeue_task(next, array);
next->prio = new_prio;
enqueue_task(next, array);
} else
requeue_task(next, array);
}
next->activated = 0;
switch_tasks:
Expand Down

0 comments on commit 0d9f840

Please sign in to comment.