Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753570AbdGNJPW (ORCPT ); Fri, 14 Jul 2017 05:15:22 -0400 Received: from terminus.zytor.com ([65.50.211.136]:53613 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751340AbdGNJPU (ORCPT ); Fri, 14 Jul 2017 05:15:20 -0400 Date: Fri, 14 Jul 2017 02:10:35 -0700 From: tip-bot for Joel Fernandes Message-ID: Cc: mingo@kernel.org, hpa@zytor.com, torvalds@linux-foundation.org, bristot@redhat.com, joelaf@google.com, tglx@linutronix.de, juri.lelli@arm.com, peterz@infradead.org, linux-kernel@vger.kernel.org Reply-To: juri.lelli@arm.com, linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@kernel.org, hpa@zytor.com, torvalds@linux-foundation.org, tglx@linutronix.de, joelaf@google.com, bristot@redhat.com In-Reply-To: <20170713022429.10307-1-joelaf@google.com> References: <20170713022429.10307-1-joelaf@google.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/urgent] sched/deadline: Fix confusing comments about selection of top pi-waiter Git-Commit-ID: 193be41e33168a3a06eb9d356d9e39c69de161d2 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2617 Lines: 57 Commit-ID: 193be41e33168a3a06eb9d356d9e39c69de161d2 Gitweb: http://git.kernel.org/tip/193be41e33168a3a06eb9d356d9e39c69de161d2 Author: Joel Fernandes AuthorDate: Wed, 12 Jul 2017 19:24:29 -0700 Committer: Ingo Molnar CommitDate: Fri, 14 Jul 2017 10:35:16 +0200 sched/deadline: Fix confusing comments about selection of top pi-waiter 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. Signed-off-by: Joel Fernandes Reviewed-by: Daniel Bristot de Oliveira Acked-by: Juri Lelli Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20170713022429.10307-1-joelaf@google.com Signed-off-by: Ingo Molnar --- 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 a84299f..755bd3f 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -1392,17 +1392,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.