Conclusion

As real-time systems become more complex and require more advanced features, the benefits of using complete GPOS to help implement some of these requirements more rapidly become increasingly appealing. Using the PREEMPT_RT patch with Linux kernel and one of the many officially supported architectures is currently one of the most

viable ways of achieving that goal if the real-time requirements are not too strict. In the meantime, the RISC-V is already getting lots of attention in the industrial space, and in the future, it will probably be a prominent player in the field of embedded devices. Once the availability of commercial RISC-V solutions improves and the Linux kernel support for RISC-V architecture progresses, together they bring a very interesting platform that can compete with other architectures. Inevitably, at some point, there will be genuine demand and support for advanced RISC-V systems that run Real-Time Linux.

With a couple of small tweaks presented in this thesis, the core of the PREEMPT_RT patch on RISC-V looks to be already fully functional. Most importantly, it does not seem to contain any fundamentally problematic sections of code that produce kernel panics, deadlocks, or other significant issues. Also, the latency measurements show promising results regarding real-time usage scenarios. This unoptimized Real-Time Linux running on a RISC-V platform can already achieve similar results to other officially supported architectures. However, the evaluated system was very minimal and therefore does not yet necessarily represent a practical system.

With PREEMPT_RT applied, even in high load situations, the maximum observed latency was kept below 150 µs. In a severe, system out-of-memory error condition, the maximum latency was well below 250 µs. This is significantly lower when compared to the mainline kernel, which experienced latencies well in the milliseconds’ region. Overall, the maximum observed latency seems to be very deterministic, so they do not depend on the system load, which is the single most important requirement for the operation of all real-time systems. These numbers are especially impressive as there are not currently any RISC-V architecture or driver-specific latency optimizations done. The main factors contributing to the current latencies still present in the PREEMPT_RT kernel seem to be related to timer interrupts and occasional raw spinlocks. Optimizing some of these parts could improve the experienced latencies even more.

Based on the latency measurements, the PREEMPT_RT on RISC-V could be already suitable for some situations that do not need better response times than 200 µs. Without any error conditions, the current system should be able to reliably respond within that time limit. However, Like LAZY_PREEMPT and other feature required to be supported. Besides, this is not yet possible in practice, as there would need to be official support for the RISC-V architecture in the PREEMPT_RT patch for any serious project. Probably in addition to this, there would need to be some proven track record to give enough confidence to use such systems in industrial projects. At the bare minimum, it will take several years even before this can be considered. It is also worth noting that adding more options to the kernel might cause some longer latencies. This matter would require additional studying in the future to know the different options that might cause problems.

The future of real-time capable Linux systems running on RISC-V architecture, in general, seems to be very promising. Different real-time extensions of Linux will be more prominent than ever before and PREEMPT_RT will have an important role in that development. Fully mainlining the PREEMPT_RT patch to Linux kernel source would only accelerate the development as there is exposure to an even bigger community. Starting from kernel v6.6, RT-Linux officially supports RISC-V architecture. With official support, it is possible to better track and resolve RT-Linux kernel issues. Also, the general RISC-V support in the Linux kernel, as well as the architecture agnostic parts of PREEMPT_RT itself, will develop continuously. There might even be some completely new features implemented to the Linux kernel that will enable even lower latencies in the future. This work will most certainly help with the future adoption of RISC-V as a viable alternative to other existing architectures. Regardless, with this study completed, the RISC-V architecture has started its journey to achieving official support for PREEMPT_RT patch.