Skip to contentSkip to conversation

Interference from CFS scheduler

DISCUSSION Allen Martin 1 participant 1 message Sep 13, 2017

lore
Share & tools
lore
#0 lore raw

I've been trying to eliminate sources of unpredictability in the latency of interrupt response in my real-time application, and I'm struggling a bit with the CFS scheduler. If a SCHED_OTHER task was preempted the rt scheduler eventually calls put_prev_task() which results in a rb tree insert in the CFS scheduler. So the latency of my real-time task depends on the scheduling class of the task I'm interrupting and how many SCHED_OTHER tasks are in the runqueue, which seems like a priority inversion.

Are there any ways to mitigate this other than trying to minimize the number of SCHED_OTHER tasks in the system? Ideally what I'd really like is to defer the work in put_prev_task_fair() until there's no real-time work to do.

-Allen