linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched: deadline: Fix confusing comments about selection of top pi-waiter
@ 2017-02-23  4:09 Joel Fernandes
  2017-02-28 11:15 ` Juri Lelli
  2017-02-28 13:06 ` Daniel Bristot de Oliveira
  0 siblings, 2 replies; 3+ messages in thread
From: Joel Fernandes @ 2017-02-23  4:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: Joel Fernandes, Juri Lelli, Ingo Molnar, Peter Zijlstra

This comment in the code is incomplete, and I believe it begs a definition of
dl_boosted to make sense of the condition that follows. Rewrite the comment and
also rearrange the condition that follows to reflect the first condition "we
have a top pi-waiter which is a SCHED_DEADLINE task" in that order. Also fix a
typo that follows.

Cc: Juri Lelli <Juri.Lelli@arm.com>
Signed-off-by: Joel Fernandes <joelaf@google.com>
---
 kernel/sched/deadline.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 70ef2b1901e4..4b86abcef135 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -928,17 +928,19 @@ static void enqueue_task_dl(struct rq *rq, struct task_struct *p, int flags)
 	struct sched_dl_entity *pi_se = &p->dl;
 
 	/*
-	 * Use the scheduling parameters of the top pi-waiter
-	 * task if we have one and its (absolute) deadline is
-	 * smaller than our one... OTW we keep our runtime and
-	 * deadline.
+	 * Use the scheduling parameters of the top pi-waiter task if:
+	 * - we have a top pi-waiter which is a SCHED_DEADLINE task AND
+	 * - our dl_boosted is set (i.e. the pi-waiter's (absolute) deadline is
+	 *   smaller than our deadline OR we are a !SCHED_DEADLINE task getting
+	 *   boosted due to a SCHED_DEADLINE pi-waiter).
+	 * Otherwise we keep our runtime and deadline.
 	 */
-	if (pi_task && p->dl.dl_boosted && dl_prio(pi_task->normal_prio)) {
+	if (pi_task && dl_prio(pi_task->normal_prio) && p->dl.dl_boosted) {
 		pi_se = &pi_task->dl;
 	} else if (!dl_prio(p->normal_prio)) {
 		/*
 		 * Special case in which we have a !SCHED_DEADLINE task
-		 * that is going to be deboosted, but exceedes its
+		 * that is going to be deboosted, but exceeds its
 		 * runtime while doing so. No point in replenishing
 		 * it, as it's going to return back to its original
 		 * scheduling class after this.
-- 
2.11.0.483.g087da7b7c-goog

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] sched: deadline: Fix confusing comments about selection of top pi-waiter
  2017-02-23  4:09 [PATCH] sched: deadline: Fix confusing comments about selection of top pi-waiter Joel Fernandes
@ 2017-02-28 11:15 ` Juri Lelli
  2017-02-28 13:06 ` Daniel Bristot de Oliveira
  1 sibling, 0 replies; 3+ messages in thread
From: Juri Lelli @ 2017-02-28 11:15 UTC (permalink / raw)
  To: Joel Fernandes; +Cc: linux-kernel, Ingo Molnar, Peter Zijlstra

Hi,

On 22/02/17 20:09, Joel Fernandes wrote:
> This comment in the code is incomplete, and I believe it begs a definition of
> dl_boosted to make sense of the condition that follows. Rewrite the comment and
> also rearrange the condition that follows to reflect the first condition "we
> have a top pi-waiter which is a SCHED_DEADLINE task" in that order. Also fix a
> typo that follows.
> 
> Cc: Juri Lelli <Juri.Lelli@arm.com>
> Signed-off-by: Joel Fernandes <joelaf@google.com>

Looks good to me.

Acked-by: Juri Lelli <juri.lelli@arm.com>

Thanks,

- Juri

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sched: deadline: Fix confusing comments about selection of top pi-waiter
  2017-02-23  4:09 [PATCH] sched: deadline: Fix confusing comments about selection of top pi-waiter Joel Fernandes
  2017-02-28 11:15 ` Juri Lelli
@ 2017-02-28 13:06 ` Daniel Bristot de Oliveira
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Bristot de Oliveira @ 2017-02-28 13:06 UTC (permalink / raw)
  To: Joel Fernandes, linux-kernel; +Cc: Juri Lelli, Ingo Molnar, Peter Zijlstra

On 02/23/2017 05:09 AM, Joel Fernandes wrote:
> This comment in the code is incomplete, and I believe it begs a definition of
> dl_boosted to make sense of the condition that follows. Rewrite the comment and
> also rearrange the condition that follows to reflect the first condition "we
> have a top pi-waiter which is a SCHED_DEADLINE task" in that order. Also fix a
> typo that follows.
> 
> Cc: Juri Lelli <Juri.Lelli@arm.com>
> Signed-off-by: Joel Fernandes <joelaf@google.com>

Reviewed-by: Daniel Bristot de Oliveira <bristot@redhat.com>

-- Daniel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-28 13:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-23  4:09 [PATCH] sched: deadline: Fix confusing comments about selection of top pi-waiter Joel Fernandes
2017-02-28 11:15 ` Juri Lelli
2017-02-28 13:06 ` Daniel Bristot de Oliveira

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).