Re: bug in sched.c:task_hot()

From: Ingo Molnar
Date: Tue Oct 05 2004 - 03:05:29 EST



* Chen, Kenneth W <kenneth.w.chen@xxxxxxxxx> wrote:

> Current implementation of task_hot() has a performance bug in it
> that it will cause integer underflow.

> -#define task_hot(p, now, sd) ((now) - (p)->timestamp < (sd)->cache_hot_time)
> +#define task_hot(p, now, sd) ((long long) ((now) - (p)->timestamp) \
> + < (long long) (sd)->cache_hot_time)

ah ... nice catch.

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>

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