]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
sched: Deadline has dynamic priority
authorPeter Zijlstra <peterz@infradead.org>
Thu, 15 Jan 2026 08:25:37 +0000 (09:25 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 15 Jan 2026 20:57:53 +0000 (21:57 +0100)
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: ff77e4685359 ("sched/rt: Fix PI handling vs. sched_setscheduler()")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Pierre Gondois <pierre.gondois@arm.com>
Tested-by: Juri Lelli <juri.lelli@redhat.com>
Link: https://patch.msgid.link/20260114130528.GB831285@noisy.programming.kicks-ass.net
kernel/sched/core.c
kernel/sched/syscalls.c

index 4d925d7ad097e1e6ee15f18c65ec299d8d4eb344..045f83ad261e25283d290fd064ad47cd2399dc79 100644 (file)
@@ -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;
index cb337de679b860b5c368e086f4abcab1693d7499..6f10db3646e7f6228e7847394c5ad45297e8c3db 100644 (file)
@@ -639,7 +639,7 @@ change:
                 * itself.
                 */
                newprio = rt_effective_prio(p, newprio);
-               if (newprio == oldprio)
+               if (newprio == oldprio && !dl_prio(newprio))
                        queue_flags &= ~DEQUEUE_MOVE;
        }