Skip to content

Commit e008ec6

Browse files
author
Peter Zijlstra
committed
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: ff77e46 ("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
1 parent 5343936 commit e008ec6

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

kernel/sched/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7320,7 +7320,7 @@ void rt_mutex_setprio(struct task_struct *p, struct task_struct *pi_task)
73207320
trace_sched_pi_setprio(p, pi_task);
73217321
oldprio = p->prio;
73227322

7323-
if (oldprio == prio)
7323+
if (oldprio == prio && !dl_prio(prio))
73247324
queue_flag &= ~DEQUEUE_MOVE;
73257325

73267326
prev_class = p->sched_class;

kernel/sched/syscalls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ int __sched_setscheduler(struct task_struct *p,
639639
* itself.
640640
*/
641641
newprio = rt_effective_prio(p, newprio);
642-
if (newprio == oldprio)
642+
if (newprio == oldprio && !dl_prio(newprio))
643643
queue_flags &= ~DEQUEUE_MOVE;
644644
}
645645

0 commit comments

Comments
 (0)