From: Peter Zijlstra <peterz@infradead.org>
To: Qi Zheng <arch0.zheng@gmail.com>
Cc: mingo@redhat.com, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
bristot@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/deadline: Replace rq_of_dl_rq(dl_rq_of_se(dl_se)) with ... ...task_rq(dl_task_of(dl_se))
Date: Tue, 13 Oct 2020 17:48:00 +0200 [thread overview]
Message-ID: <20201013154800.GV2611@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20201013143140.237750-1-arch0.zheng@gmail.com>
On Tue, Oct 13, 2020 at 10:31:40PM +0800, Qi Zheng wrote:
> The rq is already obtained in the dl_rq_of_se() function:
> struct task_struct *p = dl_task_of(dl_se);
> struct rq *rq = task_rq(p);
> So there is no need to do extra conversion.
>
> Signed-off-by: Qi Zheng <arch0.zheng@gmail.com>
> ---
> kernel/sched/deadline.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index 6d93f4518734..f64e577f6aba 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -1152,7 +1152,7 @@ void init_dl_task_timer(struct sched_dl_entity *dl_se)
> static inline void dl_check_constrained_dl(struct sched_dl_entity *dl_se)
> {
> struct task_struct *p = dl_task_of(dl_se);
> - struct rq *rq = rq_of_dl_rq(dl_rq_of_se(dl_se));
> + struct rq *rq = task_rq(p);
>
> if (dl_time_before(dl_se->deadline, rq_clock(rq)) &&
> dl_time_before(rq_clock(rq), dl_next_period(dl_se))) {
> @@ -1498,7 +1498,7 @@ enqueue_dl_entity(struct sched_dl_entity *dl_se,
> replenish_dl_entity(dl_se, pi_se);
> } else if ((flags & ENQUEUE_RESTORE) &&
> dl_time_before(dl_se->deadline,
> - rq_clock(rq_of_dl_rq(dl_rq_of_se(dl_se))))) {
> + rq_clock(task_rq(dl_task_of(dl_se))))) {
> setup_new_dl_entity(dl_se);
> }
Consider where we're going:
https://lkml.kernel.org/r/20200807095051.385985-1-juri.lelli@redhat.com
then a dl_entity is no longer immediately a task and the above is no
longer true.
next prev parent reply other threads:[~2020-10-13 15:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-13 14:31 Qi Zheng
2020-10-13 15:48 ` Peter Zijlstra [this message]
2020-10-14 6:20 ` Qi Zheng
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=20201013154800.GV2611@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=arch0.zheng@gmail.com \
--cc=bristot@redhat.com \
--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=rostedt@goodmis.org \
--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
all inboxes | Powered by JetHome®