2011-05-21 14:19:06

by Hillf Danton

[permalink] [raw]
Subject: [PATCH] sched: remove noop in next_prio()

When computing the next priority for a given run-queue, the check for
RT priority of the task determined by the pick_next_highest_task_rt()
function could be removed, since only RT task is returned by the
function.

Signed-off-by: Hillf Danton <[email protected]>
---

--- a/kernel/sched_rt.c 2011-04-27 11:48:50.000000000 +0800
+++ b/kernel/sched_rt.c 2011-05-21 22:10:34.000000000 +0800
@@ -670,7 +670,7 @@ static inline int next_prio(struct rq *r
{
struct task_struct *next = pick_next_highest_task_rt(rq, rq->cpu);

- if (next && rt_prio(next->prio))
+ if (next)
return next->prio;
else
return MAX_RT_PRIO;


2011-05-24 08:17:42

by Yong Zhang

[permalink] [raw]
Subject: Re: [PATCH] sched: remove noop in next_prio()

On Sat, May 21, 2011 at 10:19 PM, Hillf Danton <[email protected]> wrote:
> When computing the next priority for a given run-queue, the check for
> RT priority of the task determined by the pick_next_highest_task_rt()
> function could be removed, since only RT task is returned by the
> function.
>
> Signed-off-by: Hillf Danton <[email protected]>

Yup, it's true.

Reviewed-by: Yong Zhang <[email protected]>

> ---
>
> --- a/kernel/sched_rt.c 2011-04-27 11:48:50.000000000 +0800
> +++ b/kernel/sched_rt.c 2011-05-21 22:10:34.000000000 +0800
> @@ -670,7 +670,7 @@ static inline int next_prio(struct rq *r
>  {
>        struct task_struct *next = pick_next_highest_task_rt(rq, rq->cpu);
>
> -       if (next && rt_prio(next->prio))
> +       if (next)
>                return next->prio;
>        else
>                return MAX_RT_PRIO;
>



--
Only stand for myself

2011-05-24 11:53:40

by Mike Galbraith

[permalink] [raw]
Subject: Re: [PATCH] sched: remove noop in next_prio()

On Tue, 2011-05-24 at 16:17 +0800, Yong Zhang wrote:
> On Sat, May 21, 2011 at 10:19 PM, Hillf Danton <[email protected]> wrote:
> > When computing the next priority for a given run-queue, the check for
> > RT priority of the task determined by the pick_next_highest_task_rt()
> > function could be removed, since only RT task is returned by the
> > function.
> >
> > Signed-off-by: Hillf Danton <[email protected]>
>
> Yup, it's true.

(could whack the else while there)

> Reviewed-by: Yong Zhang <[email protected]>
>
> > ---
> >
> > --- a/kernel/sched_rt.c 2011-04-27 11:48:50.000000000 +0800
> > +++ b/kernel/sched_rt.c 2011-05-21 22:10:34.000000000 +0800
> > @@ -670,7 +670,7 @@ static inline int next_prio(struct rq *r
> > {
> > struct task_struct *next = pick_next_highest_task_rt(rq, rq->cpu);
> >
> > - if (next && rt_prio(next->prio))
> > + if (next)
> > return next->prio;
> > else
> > return MAX_RT_PRIO;
> >
>
>
>

2011-05-24 13:09:40

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH] sched: remove noop in next_prio()

On Sat, 2011-05-21 at 22:19 +0800, Hillf Danton wrote:
> When computing the next priority for a given run-queue, the check for
> RT priority of the task determined by the pick_next_highest_task_rt()
> function could be removed, since only RT task is returned by the
> function.
>
> Signed-off-by: Hillf Danton <[email protected]>
> ---

Acked-by: Steven Rostedt <[email protected]>

-- Steve

2011-05-24 14:23:52

by Jesper Juhl

[permalink] [raw]
Subject: Re: [PATCH] sched: remove noop in next_prio()

On Tue, 24 May 2011, Hillf Danton wrote:

> On Tue, May 24, 2011 at 7:53 PM, Mike Galbraith <[email protected]> wrote:
> > On Tue, 2011-05-24 at 16:17 +0800, Yong Zhang wrote:
> >> On Sat, May 21, 2011 at 10:19 PM, Hillf Danton <[email protected]> wrote:
> >> > When computing the next priority for a given run-queue, the check for
> >> > RT priority of the task determined by the pick_next_highest_task_rt()
> >> > function could be removed, since only RT task is returned by the
> >> > function.
> >> >
> >> > Signed-off-by: Hillf Danton <[email protected]>
> >>
> >> Yup, it's true.
> >
> > (could whack the else while there)
> >
>
> Where is it, Mike?
>


- if (next && rt_prio(next->prio))
+ if (next)
return next->prio;
- else
- return MAX_RT_PRIO;
+ return MAX_RT_PRIO;



--
Jesper Juhl <[email protected]> http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.

2011-05-24 14:20:23

by Hillf Danton

[permalink] [raw]
Subject: Re: [PATCH] sched: remove noop in next_prio()

On Tue, May 24, 2011 at 7:53 PM, Mike Galbraith <[email protected]> wrote:
> On Tue, 2011-05-24 at 16:17 +0800, Yong Zhang wrote:
>> On Sat, May 21, 2011 at 10:19 PM, Hillf Danton <[email protected]> wrote:
>> > When computing the next priority for a given run-queue, the check for
>> > RT priority of the task determined by the pick_next_highest_task_rt()
>> > function could be removed, since only RT task is returned by the
>> > function.
>> >
>> > Signed-off-by: Hillf Danton <[email protected]>
>>
>> Yup, it's true.
>
> (could whack the else while there)
>

Where is it, Mike?

thanks
Hillf

2011-05-24 14:26:36

by Hillf Danton

[permalink] [raw]
Subject: Re: [PATCH] sched: remove noop in next_prio()

On Tue, May 24, 2011 at 10:16 PM, Jesper Juhl <[email protected]> wrote:
> On Tue, 24 May 2011, Hillf Danton wrote:
>
>> On Tue, May 24, 2011 at 7:53 PM, Mike Galbraith <[email protected]> wrote:
>> > On Tue, 2011-05-24 at 16:17 +0800, Yong Zhang wrote:
>> >> On Sat, May 21, 2011 at 10:19 PM, Hillf Danton <[email protected]> wrote:
>> >> > When computing the next priority for a given run-queue, the check for
>> >> > RT priority of the task determined by the pick_next_highest_task_rt()
>> >> > function could be removed, since only RT task is returned by the
>> >> > function.
>> >> >
>> >> > Signed-off-by: Hillf Danton <[email protected]>
>> >>
>> >> Yup, it's true.
>> >
>> > (could whack the else while there)
>> >
>>
>> Where is it, Mike?
>>
>
>
> -       if (next && rt_prio(next->prio))
> +       if (next)
>               return next->prio;
> -       else
> -              return MAX_RT_PRIO;
> +       return MAX_RT_PRIO;
>
>
>
> --
> Jesper Juhl <[email protected]>       http://www.chaosbits.net/
> Don't top-post http://www.catb.org/jargon/html/T/top-post.html
> Plain text mails only, please.
>
>

Very cool, thank you:)

Hillf