Using DL servers for FIFO tasks starvation avoidance
igalia
15 views
11 slides
Oct 14, 2024
Slide 1 of 11
1
2
3
4
5
6
7
8
9
10
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...
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 could lead to system deadlock.
I would like to open the discussion about the possibility of using deadline
servers as a mechanism to prevent such situations and what conditions and
policies would be acceptable by the community for such an implementation.
(c) Linux Plumbers Conference 2024
Vienna, Austria
September 18-20, 2024
https://lpc.events/event/18/
https://www.youtube.com/watch?v=QTBSmZ87eQw
Size: 144.17 KB
Language: en
Added: Oct 14, 2024
Slides: 11 pages
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