Some interesting background information on the Linux RT patch, the effect it has had in the past. It is interesting that Printk was the final hurdle – something so seemingly simple, yet difficult.
It turns out that a lot of musicians were early real-time Linux users because it let them produce high-quality recordings on the cheap. Who knew? Other real-time Linux features that has slipped into the mainline kernel over the years include:
- The introduction of mutexes
- Ftrace, arguably the most important Linux debugging tool
- Priority inheritance for user-space applications
So, why is Real-Time Linux only now completely blessed in the kernel? “We actually would not push something up unless we thought it was ready,” Rostedt explained. “Almost everything was usually rewritten at least three times before it went into mainline because we had such a high bar for what would go in.”
The final hurdle for full integration was reworking the kernel’s print_k function, a critical debugging tool dating back to 1991. Torvalds was particularly protective of print_k --He wrote the original code and still uses it for debugging. However, print_k also puts a hard delay in a Linux program whenever it’s called. That kind of slowdown is unacceptable in real-time systems.
Rostedt explained: “Print_k has a thousand hacks to handle a thousand different situations. Whenever we modified print_k to do something, it would break one of these cases. The thing about print_k that’s great about debugging is you can know exactly where you were when a process crashed. When I would be hammering the system really, really hard, and the latency was mostly around maybe 30 microseconds, and then suddenly it would jump to five milliseconds.” That delay was the print_k message.
After much work, many heated discussions, and several rejected proposals, a compromise was reached earlier this year. Torvalds is happy, the real-time Linux developers are happy, priint_K users are happy, and, at long last, real-time Linux is real.
Another article:
https://lwn.net/Articles/989212/
With the printk bits merged, PREEMPT_RT could be enabled on X86, ARM64 and Risc-V. These three architectures merged required changes over the years leaving me in a position where I have no essential changes in the queue that would affect them.
This again emphasizes that the MPU world is being reduced to three architectures. Anything else is not a good bet for new product development.