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

Unverified Commit 0530ef61 authored by Sultan Alsawaf's avatar Sultan Alsawaf Committed by Gagan Malvi
Browse files

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: default avatarSultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: default avatarOktapra Amtono <oktapra.amtono@gmail.com>
Signed-off-by: default avatarCloudedQuartz <ravenklawasd@gmail.com>
parent b7f55d4f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -5142,7 +5142,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);