Re: [BUG] How to get real-time priority using idle priority

From: Mike Galbraith
Date: Thu Jan 15 2009 - 05:30:43 EST


On Thu, 2009-01-15 at 11:14 +0100, Peter Zijlstra wrote:
> On Thu, 2009-01-15 at 10:28 +0100, Mike Galbraith wrote:

> OK, so why did I write it like that to begin with...
>
> Aah, yes.
>
> Say we've just dequeued current
>
> schedule
> deactivate_task(prev)
> dequeue_entity
> update_min_vruntime
>
> Then we'll set
>
> vruntime = cfs_rq->min_vruntime;
>
> we find !cfs_rq->curr, but do find someone in the tree. Then we _must_
> do vruntime = se->vruntime, because
>
> vruntime = min_vruntime(vruntime := cfs_rq->min_vruntime, se->vruntime)
>
> will not advance vruntime, and cause lags the other way around (which we
> fixed with that initial patch: 1af5f730fc1bf7c62ec9fb2d307206e18bf40a69
> (sched: more accurate min_vruntime accounting).
>
> Which leads me to suggest the following
>
> ---
> diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
> index 8e1352c..f2d2d94 100644
> --- a/kernel/sched_fair.c
> +++ b/kernel/sched_fair.c
> @@ -283,7 +283,7 @@ static void update_min_vruntime(struct cfs_rq
> *cfs_rq)
> struct sched_entity,
> run_node);
>
> - if (vruntime == cfs_rq->min_vruntime)
> + if (!cfs_rq->curr)
> vruntime = se->vruntime;
> else
> vruntime = min_vruntime(vruntime, se->vruntime);

Aha. Yeah, I'll re-test with that instead.

> The below can be split into 3 patches:
>
> - the idle weight change (do we really need that? why?)

I saw idle tasks slamming extremely far. I'll verify, less is more.

-Mike

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