Re: [PATCH 3/5] sched: remove unlikely in pre_schedule_rt

From: Steven Rostedt
Date: Wed Mar 25 2009 - 01:25:00 EST




On Wed, 25 Mar 2009, Steven Rostedt wrote:

> From: Steven Rostedt <rostedt@xxxxxxxxxxx>
>
> Impact: clean up
>
> The annotated branch profiler shows that the unlikely used by
> pre_schedule_rt is always incorrect. This makes sense because in
> sched.c we have:
>
> if (prev->sched_class->pre_schedule)
> prev->sched_class->pre_schedule(rq, prev);
>
> And we are saying that prev is unlikely to be an rt task. This looks
> more like a likely candidate to me.

I forgot to add the profiler output:

correct incorrect % Function File Line
------- --------- - -------- ---- ----
0 2248 100 pre_schedule_rt sched_rt.c 1263


-- Steve

>
> Signed-off-by: Steven Rostedt <srostedt@xxxxxxxxxx>
> ---
> 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 bac1061..537af77 100644
> --- a/kernel/sched_rt.c
> +++ b/kernel/sched_rt.c
> @@ -1260,7 +1260,7 @@ static int pull_rt_task(struct rq *this_rq)
> static void pre_schedule_rt(struct rq *rq, struct task_struct *prev)
> {
> /* Try to pull RT tasks here if we lower this rq's prio */
> - if (unlikely(rt_task(prev)) && rq->rt.highest_prio > prev->prio)
> + if (rt_task(prev) && rq->rt.highest_prio > prev->prio)
> pull_rt_task(rq);
> }
>
> --
> 1.6.2
>
> --
>
--
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/