Re: [PATCH]sched: convert wall-time to vruntime forcheck_preempt_tick

From: Mike Galbraith
Date: Thu Apr 07 2011 - 09:34:28 EST


On Thu, 2011-04-07 at 20:43 +0800, Shaohua Li wrote:
> In check_preempt_tick(), delta is vruntime and ideal_runtime is wall runtime.
> Comparing vruntime and ideal_runtime looks buggy.

Why is that buggy? It's a distance in units ns, ala wakeup_granularity,
a number. This number just happens to be variable.

> Signed-off-by: Shaohua Li <shaohua.li@xxxxxxxxx>
>
> diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
> index 3f7ec9e..0b76e3a 100644
> --- a/kernel/sched_fair.c
> +++ b/kernel/sched_fair.c
> @@ -1121,7 +1121,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
> if (delta < 0)
> return;
>
> - if (delta > ideal_runtime)
> + if (delta > calc_delta_fair(ideal_runtime, curr))
> resched_task(rq_of(cfs_rq)->curr);
> }
> }
> --
> 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/


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