From: Steven Rostedt <rostedt@goodmis.org>
To: Hui Su <sh_def@163.com>
Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
bsegall@google.com, mgorman@suse.de,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/rt.c remove unnecessary parameter in pick_next_rt_entity
Date: Tue, 29 Sep 2020 20:29:16 -0400 [thread overview]
Message-ID: <20200929202916.7e26f4cb@oasis.local.home> (raw)
In-Reply-To: <20200929165640.GA28986@rlk>
On Wed, 30 Sep 2020 00:56:40 +0800
Hui Su <sh_def@163.com> wrote:
> struct rq is not necessary for pick_next_rt_entity(),
> we can get next sched_rt_entity just from struct rt_rq.
>
> Signed-off-by: Hui Su <sh_def@163.com>
> ---
> kernel/sched/rt.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
> index f215eea6a966..113965e1952c 100644
> --- a/kernel/sched/rt.c
> +++ b/kernel/sched/rt.c
> @@ -1593,11 +1593,9 @@ static inline void set_next_task_rt(struct rq *rq, struct task_struct *p, bool f
> rt_queue_push_tasks(rq);
> }
>
> -static struct sched_rt_entity *pick_next_rt_entity(struct rq *rq,
> - struct rt_rq *rt_rq)
> +static struct sched_rt_entity *pick_next_rt_entity(struct rt_rq *rt_rq)
> {
> struct rt_prio_array *array = &rt_rq->active;
> - struct sched_rt_entity *next = NULL;
> struct list_head *queue;
> int idx;
>
> @@ -1605,9 +1603,8 @@ static struct sched_rt_entity *pick_next_rt_entity(struct rq *rq,
> BUG_ON(idx >= MAX_RT_PRIO);
>
> queue = array->queue + idx;
> - next = list_entry(queue->next, struct sched_rt_entity, run_list);
>
> - return next;
> + return list_entry(queue->next, struct sched_rt_entity, run_list);
The above code looks to be left over from a time that there was a goto
out; with out: being between the next = list_etry() and the return
next. This was removed back in 2008 with commit 326587b84078 ("sched:
fix goto retry in pick_next_task_rt()").
The above looks fine to me.
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-- Steve
> }
>
> static struct task_struct *_pick_next_task_rt(struct rq *rq)
> @@ -1616,7 +1613,7 @@ static struct task_struct *_pick_next_task_rt(struct rq *rq)
> struct rt_rq *rt_rq = &rq->rt;
>
> do {
> - rt_se = pick_next_rt_entity(rq, rt_rq);
> + rt_se = pick_next_rt_entity(rt_rq);
> BUG_ON(!rt_se);
> rt_rq = group_rt_rq(rt_se);
> } while (rt_rq);
prev parent reply other threads:[~2020-09-30 0:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-29 16:56 [PATCH] sched/rt.c remove unnecessary parameter in pick_next_rt_entity Hui Su
2020-09-30 0:29 ` Steven Rostedt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200929202916.7e26f4cb@oasis.local.home \
--to=rostedt@goodmis.org \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=sh_def@163.com \
--cc=vincent.guittot@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox