sched/core: Use SCHED_RR in place of SCHED_FIFO for all users

Although SCHED_FIFO is a real-time scheduling policy, it can have bad
results on system latency, since each SCHED_FIFO task will run to
completion before yielding to another task. This can result in visible
micro-stalls when a SCHED_FIFO task hogs the CPU for too long. On a
system where latency is favored over throughput, using SCHED_RR is a
better choice than SCHED_FIFO.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Oktapra Amtono <oktapra.amtono@gmail.com>
Signed-off-by: CloudedQuartz <ravenklawasd@gmail.com>
This commit is contained in:
Sultan Alsawaf 2021-01-26 22:05:53 -08:00 committed by Ksawlii
parent cda8f45b3b
commit 74cbd01416

View file

@ -5442,7 +5442,8 @@ static void __setscheduler_params(struct task_struct *p,
if (policy == SETPARAM_POLICY)
policy = p->policy;
p->policy = policy;
/* Replace SCHED_FIFO with SCHED_RR to reduce latency */
p->policy = policy == SCHED_FIFO ? SCHED_RR : policy;
if (dl_policy(policy))
__setparam_dl(p, attr);