Let the Kernel Monitor Your Real-Time Application
summary
A runtime verifier called RT app monitor lives in mainline (introduced 6.17, production-safe to compile in from 7.3) and checks real-time tasks for page faults, illegal sleeping/waking, wrong nanosleep usage, and missing priority-inheritance on mutexes; activation is two simple kernel writes (choose the printk reactor and echo 1) and violations appear in dmesg, with perf able to capture full backtraces. It finds concrete failures: timerfd on PREEMPT_RT wakes from ktimers (prio 1) causing inversion, pipes/unix sockets/io_uring block writers and risk inversion; use clock_nanosleep, eventfd, shared memory, or larger buffers instead.
AI-written summary · about
chapters (18)
- 0:00Introduction to real-time monitoring
- 4:55Event flow and priority inversion risks
- 5:56Runtime verification concept
- 8:01Enabling the RT app monitor
- 9:48Using perf for detailed traces
- 10:51Timerfd issues in PREEMPT_RT
- 13:57Clock nanosleep as safe alternative
- 15:00Pipe IPC priority inversion
- 18:50Unix domain sockets analysis
- 20:15IO_uring violations overview
- 22:42Kernel-level pitfalls summary
- 23:44Production kernel integration
- 24:04Real-time Linux community resources
- 25:10glibc condition variable fixes
- 26:52Tracing method comparison
- 27:54Socket CAN monitoring efforts
- 28:41Q&A: Production overhead concerns
- 30:25Q&A: System-wide vs per-process monitoring
