mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Daniel Bristot de Oliveira <bristot@redhat.com>
Cc: linux-kernel@vger.kernel.org, Xunlei Pang <xpang@redhat.com>,
	Ingo Molnar <mingo@redhat.com>, Juri Lelli <juri.lelli@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Luca Abeni <luca.abeni@santannapisa.it>,
	Tommaso Cucinotta <tommaso.cucinotta@sssup.it>,
	Romulo Silva de Oliveira <romulo.deoliveira@ufsc.br>
Subject: Re: [PATCH V2 2/2] sched/deadline: Use the revised wakeup rule for suspending constrained dl tasks
Date: Tue, 30 May 2017 13:29:32 +0200	[thread overview]
Message-ID: <20170530112932.yjw2dobbvhpyd2mp@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <5c800ab3a74a168a84ee5f3f84d12a02e11383be.1495803804.git.bristot@redhat.com>

On Mon, May 29, 2017 at 04:24:03PM +0200, Daniel Bristot de Oliveira wrote:
> +/*
> + * Regarding the deadline, a task with implicit deadline has a relative
> + * deadline == relative period. A task with constrained deadline has a
> + * relative deadline <= relative period.
> + *
> + * Linux supports constrained deadline tasks. However, there are some
> + * restrictions applied only for tasks with constrained deadline which are
> + * not implicit deadline tasks. See update_dl_entity() to know more about
> + * such restrictions.
> + *
> + * The dl_is_constrained() returns true if the task has a constrained but
> + * not implicit deadline.
> + */
> +static inline bool dl_is_constrained(struct sched_dl_entity *dl_se)
> +{
> +	return dl_se->dl_deadline < dl_se->dl_period;
> +}

OK, given that:

implicit    - deadline == period
constrained - deadline <= period

and thus constrained can still be implicit, our function
dl_is_constrained() is wrong.

I've replaced the above with dl_is_implicit().

--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -740,19 +740,17 @@ update_dl_revised_wakeup(struct sched_dl
 /*
  * Regarding the deadline, a task with implicit deadline has a relative
  * deadline == relative period. A task with constrained deadline has a
- * relative deadline < relative period.
+ * relative deadline <= relative period.
  *
- * We supports constrained deadline tasks. However, there are some
- * restrictions applied only for tasks with constrained deadline which are
- * not implicit deadline tasks. See update_dl_entity() to know more about
- * such restrictions.
+ * We support constrained deadline tasks. However, there are some restrictions
+ * applied only for tasks which do not have an implicit deadline. See
+ * update_dl_entity() to know more about such restrictions.
  *
- * The dl_is_constrained() returns true if the task has a constrained
- * (not implicit) deadline.
+ * The dl_is_implicit() returns true if the task has an implicit deadline.
  */
-static inline bool dl_is_constrained(struct sched_dl_entity *dl_se)
+static inline bool dl_is_implicit(struct sched_dl_entity *dl_se)
 {
-	return dl_se->dl_deadline < dl_se->dl_period;
+	return dl_se->dl_deadline == dl_se->dl_period;
 }
 
 /*
@@ -794,7 +792,7 @@ static void update_dl_entity(struct sche
 	if (dl_time_before(dl_se->deadline, rq_clock(rq)) ||
 	    dl_entity_overflow(dl_se, pi_se, rq_clock(rq))) {
 
-		if (unlikely(dl_is_constrained(dl_se) &&
+		if (unlikely(!dl_is_implicit(dl_se) &&
 			     !dl_time_before(dl_se->deadline, rq_clock(rq)) &&
 			     !dl_se->dl_boosted)){
 			update_dl_revised_wakeup(dl_se, rq);
@@ -1386,7 +1384,7 @@ static void enqueue_task_dl(struct rq *r
 	 * If that is the case, the task will be throttled and
 	 * the replenishment timer will be set to the next period.
 	 */
-	if (!p->dl.dl_throttled && dl_is_constrained(&p->dl))
+	if (!p->dl.dl_throttled && !dl_is_implicit(&p->dl))
 		dl_check_constrained_dl(&p->dl);
 
 	if (p->on_rq == TASK_ON_RQ_MIGRATING || flags & ENQUEUE_RESTORE) {

  parent reply	other threads:[~2017-05-30 11:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-29 14:24 [PATCH V2 0/2] sched/deadline: Revised wakeup " Daniel Bristot de Oliveira
2017-05-29 14:24 ` [PATCH V2 1/2] sched/deadline: Fixes a comment: dl_bw = dl_runtime / dl_period Daniel Bristot de Oliveira
2017-06-08  9:29   ` [tip:sched/core] sched/deadline: Fix dl_bw comment tip-bot for Daniel Bristot de Oliveira
2017-05-29 14:24 ` [PATCH V2 2/2] sched/deadline: Use the revised wakeup rule for suspending constrained dl tasks Daniel Bristot de Oliveira
2017-05-29 14:39   ` Daniel Bristot de Oliveira
2017-05-30 11:29   ` Peter Zijlstra [this message]
2017-05-30 11:31     ` Daniel Bristot de Oliveira
2017-06-08  9:30   ` [tip:sched/core] " tip-bot for Daniel Bristot de Oliveira

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=20170530112932.yjw2dobbvhpyd2mp@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bristot@redhat.com \
    --cc=juri.lelli@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.abeni@santannapisa.it \
    --cc=mingo@redhat.com \
    --cc=romulo.deoliveira@ufsc.br \
    --cc=rostedt@goodmis.org \
    --cc=tommaso.cucinotta@sssup.it \
    --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

all inboxes | Powered by JetHome®