Re: [PATCH] sched: fix how RT task is pulled

From: Yong Zhang
Date: Mon May 16 2011 - 22:35:42 EST


On Sun, May 15, 2011 at 10:50 AM, Hillf Danton <dhillf@xxxxxxxxx> wrote:
> When pulling RT task for a given runqueue, if it is already overloaded
> with RT tasks, the pull operation could be avoided at the moment.
>
> btw, it looks like a typo?

No.

Below is how rt_overloaded() is realized:
static inline int rt_overloaded(struct rq *rq)
{
return atomic_read(&rq->rd->rto_count);
}

You can notice it's about the overload of the very root_domain.

Thanks,
Yong

>
> Signed-off-by: Hillf Danton <dhillf@xxxxxxxxx>
> ---
> Âkernel/sched_rt.c | Â Â2 +-
> Â1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
> index 19ecb31..14c764b 100644
> --- a/kernel/sched_rt.c
> +++ b/kernel/sched_rt.c
> @@ -1440,7 +1440,7 @@ static int pull_rt_task(struct rq *this_rq)
> Â Â Â Âstruct task_struct *p;
> Â Â Â Âstruct rq *src_rq;
>
> - Â Â Â if (likely(!rt_overloaded(this_rq)))
> + Â Â Â if (unlikely(rt_overloaded(this_rq)))
> Â Â Â Â Â Â Â Âreturn 0;
>
> Â Â Â Âfor_each_cpu(cpu, this_rq->rd->rto_mask) {
>



--
Only stand for myself
--
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/