Commit e008ec6c authored by Peter Zijlstra's avatar Peter Zijlstra
Browse files

sched: Deadline has dynamic priority



While FIFO/RR have static priority, DEADLINE is a dynamic priority
scheme. Notably it has static priority -1. Do not assume the priority
doesn't change for deadline tasks just because the static priority
doesn't change.

This ensures DL always sees {DE,EN}QUEUE_MOVE where appropriate.

Fixes: ff77e468 ("sched/rt: Fix PI handling vs. sched_setscheduler()")
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: default avatarPierre Gondois <pierre.gondois@arm.com>
Tested-by: default avatarJuri Lelli <juri.lelli@redhat.com>
Link: https://patch.msgid.link/20260114130528.GB831285@noisy.programming.kicks-ass.net
parent 53439363
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7320,7 +7320,7 @@ void rt_mutex_setprio(struct task_struct *p, struct task_struct *pi_task)
	trace_sched_pi_setprio(p, pi_task);
	oldprio = p->prio;

	if (oldprio == prio)
	if (oldprio == prio && !dl_prio(prio))
		queue_flag &= ~DEQUEUE_MOVE;

	prev_class = p->sched_class;
+1 −1
Original line number Diff line number Diff line
@@ -639,7 +639,7 @@ int __sched_setscheduler(struct task_struct *p,
		 * itself.
		 */
		newprio = rt_effective_prio(p, newprio);
		if (newprio == oldprio)
		if (newprio == oldprio && !dl_prio(newprio))
			queue_flags &= ~DEQUEUE_MOVE;
	}