Using DL servers for FIFO tasks starvation avoidance

igalia 15 views 11 slides Oct 14, 2024
Slide 1
Slide 1 of 11
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11

About This Presentation

FIFO tasks may starve other non-RT tasks, which is mitigated by RT throttling.

Deadline servers have been introduced and are still under development as an
alternative to mitigate and avoid starvation of non-RT tasks.

There is, however, the chance that some other FIFO tasks will be starved and
that...


Slide Content

September 19, 2024
Using DL servers for FIFO tasks
starvation avoidance
1 / 11
Thadeu Lima de Souza Cascardo

September 19, 2024
Using DL servers for FIFO tasks starvation avoidance
2 / 11
On the author
●Kernel generalist developer
●Specialized in finding and fixing bugs

September 19, 2024
Using DL servers for FIFO tasks starvation avoidance
3 / 11
Problem Background
●SCHED_FIFO tasks run until they sleep or a higher priority
thread becomes runnable
●Non SCHED_FIFO tasks may run by using a throttling
mechanism
●Same-priority SCHED_FIFO tasks will run in FIFO list order
if the running task sleeps

September 19, 2024
Using DL servers for FIFO tasks starvation avoidance
4 / 11
Problem statement
●FIFO tasks may be starved by other FIFO tasks
●Those starved tasks may be waiting for mutexes
or even hold them
●That may starve other tasks as well
●RCU stalls and task hangs warnings may trigger

September 19, 2024
Using DL servers for FIFO tasks starvation avoidance
5 / 11
Proposed solutions
●In LPC 2021, Sharan Turlapati and Srivatsa Bhat
presented
“Linux Kernel Support for Kernel Thread Starvation
Avoidance”
●stalld userspace solution
●A Kernel stall monitor was proposed
●Mailing list patches were not found

September 19, 2024
Using DL servers for FIFO tasks starvation avoidance
6 / 11
Deadline servers
●Introduced as a mechanism to allow fair tasks
to run, that is, avoid starvation
●Still work in progress, only partially merged
●Allow a SCHED_DEADLINE entity to service
lower priority tasks

September 19, 2024
Using DL servers for FIFO tasks starvation avoidance
7 / 11
Proposal
●Use DL servers to avoid starving FIFO tasks
●Introduce an rt_server that would service
starving tasks under SCHED_DEADLINE
●Challenges: how to pick up the next task

September 19, 2024
Using DL servers for FIFO tasks starvation avoidance
8 / 11
Alternatives
●This is working as designed even if it allows
system hangs.
●stalld should be used until misbehaving
programs or kernel threads are fixed
●Corner cases should be fixed when identified

September 19, 2024
Using DL servers for FIFO tasks starvation avoidance
9 / 11
Open discussion
Join us!
https://www.igalia.com/jobs

10 / 11

September 19, 2024
Using DL servers for FIFO tasks starvation avoidance
11 / 11
Backup
●Case in point:
–vhost kthread consuming from an eventfd
may lead to an infinite loop
–it inherits scheduling policies from task
starting the kthread