Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 193be41e authored by Joel Fernandes's avatar Joel Fernandes Committed by Ingo Molnar
Browse files

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: default avatarJoel Fernandes <joelaf@google.com>
Reviewed-by: default avatarDaniel Bristot de Oliveira <bristot@redhat.com>
Acked-by: default avatarJuri Lelli <juri.lelli@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20170713022429.10307-1-joelaf@google.com


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 0e4097c3
Loading
Loading
Loading
Loading
+8 −6
Original line number Original line Diff line number Diff line
@@ -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;
	struct sched_dl_entity *pi_se = &p->dl;


	/*
	/*
	 * Use the scheduling parameters of the top pi-waiter
	 * Use the scheduling parameters of the top pi-waiter task if:
	 * task if we have one and its (absolute) deadline is
	 * - we have a top pi-waiter which is a SCHED_DEADLINE task AND
	 * smaller than our one... OTW we keep our runtime and
	 * - our dl_boosted is set (i.e. the pi-waiter's (absolute) deadline is
	 * deadline.
	 *   smaller than our deadline OR we are a !SCHED_DEADLINE task getting
	 */
	 *   boosted due to a SCHED_DEADLINE pi-waiter).
	if (pi_task && p->dl.dl_boosted && dl_prio(pi_task->normal_prio)) {
	 * Otherwise we keep our runtime and deadline.
	 */
	if (pi_task && dl_prio(pi_task->normal_prio) && p->dl.dl_boosted) {
		pi_se = &pi_task->dl;
		pi_se = &pi_task->dl;
	} else if (!dl_prio(p->normal_prio)) {
	} else if (!dl_prio(p->normal_prio)) {
		/*
		/*
		 * Special case in which we have a !SCHED_DEADLINE task
		 * 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
		 * runtime while doing so. No point in replenishing
		 * it, as it's going to return back to its original
		 * it, as it's going to return back to its original
		 * scheduling class after this.
		 * scheduling class after this.