From: Steven Rostedt <rostedt@goodmis.org>
To: Juri Lelli <juri.lelli@arm.com>
Cc: peterz@infradead.org, linux-kernel@vger.kernel.org,
mingo@redhat.com, luca.abeni@unitn.it, xpang@redhat.com
Subject: Re: [PATCH v5] sched/deadline: remove useless param from setup_new_dl_entity
Date: Fri, 5 Aug 2016 09:56:43 -0400 [thread overview]
Message-ID: <20160805095643.130194cf@gandalf.local.home> (raw)
In-Reply-To: <1470391799-22939-1-git-send-email-juri.lelli@arm.com>
On Fri, 5 Aug 2016 11:09:59 +0100
Juri Lelli <juri.lelli@arm.com> wrote:
> @@ -1720,19 +1720,28 @@ static void switched_from_dl(struct rq *rq, struct task_struct *p)
> */
> static void switched_to_dl(struct rq *rq, struct task_struct *p)
> {
> - if (dl_time_before(p->dl.deadline, rq_clock(rq)))
> - setup_new_dl_entity(&p->dl, &p->dl);
>
> - if (task_on_rq_queued(p) && rq->curr != p) {
> + if (task_on_rq_queued(p)) {
I always hated functions totally encapsulated by an if statement. This
can be a bit simpler (and less indented) if you have:
/* If p is not queued, its parameters will be updated at wakeup */
if (!task_on_rq_queued(p))
return;
[...]
Other than that, it looks good.
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
-- Steve
> + /*
> + * If p is not queued we will update its parameters at next
> + * wakeup. If p is dl_boosted we already updated its params in
> + * rt_mutex_setprio()->enqueue_task(..., ENQUEUE_REPLENISH),
> + * p's deadline being now already after rq_clock(rq).
> + */
> + if (dl_time_before(p->dl.deadline, rq_clock(rq)))
> + setup_new_dl_entity(&p->dl);
> +
> + if (rq->curr != p) {
> #ifdef CONFIG_SMP
> - if (tsk_nr_cpus_allowed(p) > 1 && rq->dl.overloaded)
> - queue_push_tasks(rq);
> + if (tsk_nr_cpus_allowed(p) > 1 && rq->dl.overloaded)
> + queue_push_tasks(rq);
> #else
> - if (dl_task(rq->curr))
> - check_preempt_curr_dl(rq, p, 0);
> - else
> - resched_curr(rq);
> + if (dl_task(rq->curr))
> + check_preempt_curr_dl(rq, p, 0);
> + else
> + resched_curr(rq);
> #endif
> + }
> }
> }
>
next prev parent reply other threads:[~2016-08-05 13:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-05 10:09 [PATCH v5] sched/deadline: remove useless param from setup_new_dl_entity Juri Lelli
2016-08-05 12:41 ` Xunlei Pang
2016-08-05 13:56 ` Steven Rostedt [this message]
2016-08-05 14:34 ` Juri Lelli
2016-08-05 14:54 ` Steven Rostedt
2016-08-05 15:02 ` Juri Lelli
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=20160805095643.130194cf@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=juri.lelli@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.abeni@unitn.it \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=xpang@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).