Re: [patch] sched-2.5.64-bk10-C4

Eric Wong (eric@yhbt.net)
Thu, 20 Mar 2003 16:44:09 -0800


Ingo Molnar <mingo@elte.hu> wrote:
>
> the attached patch fixes a fundamental (and long-standing) bug in the
> sleep-average estimator which is the root cause of the "contest
> process_load" problems reported by Mike Galbraith and Andrew Morton, and
> which problem is addressed by Mike's patch.

> --- linux/kernel/sched.c.orig
> +++ linux/kernel/sched.c
> @@ -342,10 +342,10 @@ static inline void __activate_task(task_
> */
> static inline int activate_task(task_t *p, runqueue_t *rq)
> {
> - unsigned long sleep_time = jiffies - p->last_run;
> + long sleep_time = jiffies - p->last_run - 1;
> int requeue_waker = 0;
>
> - if (sleep_time) {
> + if (sleep_time > 0) {
> int sleep_avg;
>
> /*
>

Would this be an equivalent fix for 2.4.20-ck4?

--- kernel/sched.c 2003-03-20 16:33:07.000000000 -0800
+++ kernel/sched.c.orig 2003-03-20 16:38:51.000000000 -0800
@@ -307,10 +286,10 @@

static inline void activate_task(task_t *p, runqueue_t *rq)
{
- long sleep_time = jiffies - p->sleep_timestamp - 1;
+ unsigned long sleep_time = jiffies - p->sleep_timestamp;
prio_array_t *array = rq->active;

- if (!rt_task(p) && (sleep_time > 0)) {
+ if (!rt_task(p) && sleep_time) {
/*
* This code gives a bonus to interactive tasks. We update
* an 'average sleep time' value here, based on

-- 
Eric Wong
-
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/