25 September 2024

PREEMPT_RT: Real Time Linux is finally part of the Linux Kernel

Realtime Linux officially enters the Linux kernel with the 6.12 release, bringing real-time capabilities to critical industrial and embedded applications.

Realtime Linux

The open source software landscape is dotted with projects that aim to improve and optimize the Linux operating system in various areas. One of these, which has seen a long evolution, is the Real Time Linux (RTL) project, which has as its main objective that of ensuring the system's ability to respond to events or complete operations within predetermined time intervals. The patch that makes all this possible is called PREEMPT_RT, and the big news for 2024 is that it will finally be included in the Linux kernel mainline starting with version 6.12.

This inclusion represents a significant turning point for the project, not only for the technical implications, but also for the long journey it has had to face. After almost 20 years of debates, technical challenges, limited resources and marginal support, the Linux kernel will officially integrate a feature requested by specific industry and development niches. Let's see what Real Time Linux means exactly, why it was so difficult to integrate it into the kernel and what the future impacts will be.

What is Real Time Linux?

Before we delve into the topic of including the PREEMPT_RT patch in the Linux kernel, it is important to understand what Real Time Linux is and why it is so relevant in some areas.

Un real-time operating system (Real-Time Operating System, or RTOS) is a system designed to execute tasks within a specified time frame, ensuring that critical operations are completed reliably within specific time intervals. In other words, real-time systems are optimized to respond to events with extremely low and predictable latency.

Linux and Real Time

Linux, in its standard configuration, is not a real-time operating system. While it is great for a wide range of applications, its ability to handle critical real-time operations is limited without significant modification. This is where the PREEMPT_RT patch comes in.

PREEMPT_RT is a series of patches that modify the kernel to improve preemption (pre-emption), allowing for more accurate process management and significantly reducing system latency. Preemption, in general, is the ability to interrupt the execution of a process to allow the execution of another process with a higher priority. In the context of real-time systems, this feature is fundamental: critical operations must be performed without unexpected delays.

Without PREEMPT_RT, Linux can handle many tasks simultaneously, but it cannot guarantee that a given task will be completed in a given time. With PREEMPT_RT, however, you get a kernel configuration that guarantees exactly this, making Linux a suitable platform for critical real-time applications such as:

  • Embedded systems in automobiles.
  • Medical devices.
  • Industrial control systems.
  • Robotic applications.

Any system where delays in operations could have serious consequences, such as errors in surgical operations, malfunctions in industrial production lines, or safety issues in autonomous vehicles, can benefit from a kernel optimized for real-time.

The long road to inclusion

One of the most interesting aspects of integrating PREEMPT_RT into the Linux kernel is how long it took: almost 20 years. The Real Time Linux project started in the early 2000s, but it wasn't until the release of the Linux 6.12 kernel that the patch was finally included in the mainline.

The technical challenges

The first challenge that delayed the inclusion of PREEMPT_RT was purely technical. Although Linux is known for its modularity and ability to accommodate third-party patches, the nature of the PREEMPT_RT patch required profound changes to the kernel's internal workings. The Linux kernel is built to be generic and optimized for a wide range of uses, from servers to desktop devices to embedded systems. This generic approach, however, is not immediately compatible with the needs of real-time systems, where predictability of operation is critical.

The integration of PREEMPT_RT required a series of trade-offs and optimizations that had to be carefully considered to avoid compromising the overall performance of the kernel. The challenge was to make the patch part of the kernel without degrading the performance of non-real-time systems. The technical difficulties therefore extended the review and development times.

The initial lack of interest

Another reason why inclusion took so long is related to the politics and priorities of the Linux community. Although the PREEMPT_RT patch had clear benefits for some industrial and scientific applications, these represented a small percentage of the Linux user base. Most Linux users use the system for servers, desktops, and mobile devices, where real-time requirements are not critical.

For many years, therefore, the kernel development community focused its resources and attention on other areas, such as scalability for data centers, improving overall performance, and hardware support. Real-time requirements were not considered a priority by most developers, further slowing down the progress of PREEMPT_RT.

Limited resources and the economic factor

Another obstacle was the financial and human resources available to the project. Producing a patch of this magnitude and keeping it updated over time requires significant resources, both in terms of time and money. In the long term, the Real Time Linux project suffered from a lack of adequate funding to support a stable and sufficient development team to overcome all the technical challenges. However, thanks to the support of companies such as Intel, Red Hat, Google and others who recognized the value of Linux in real-time applications, the project was able to move forward.

The revolution with Linux Kernel 6.12

The 6.12 release of the Linux kernel finally marks the turning point. After years of discussions, fixes and tests, the PREEMPT_RT patch will be integrated into the mainline, meaning that it will be officially part of the kernel and will no longer require external patches to be used.

This is an important step not only for the Real Time Linux project, but also for the entire Linux ecosystem. Having real-time functionality directly in the mainline kernel opens up new possibilities for the development of mission-critical applications, especially in areas where Linux is not yet widely adopted.

Impacts and implications

The inclusion of PREEMPT_RT in the kernel has several implications:

  1. Better long-term support: With the patch integrated into the main kernel, it will be easier to keep it up to date and compatible with new kernel versions. Developers will no longer have to worry about applying and managing separate patches to achieve real-time functionality.
  2. Wider adoption: Companies and developers requiring real-time capabilities will be more inclined to choose Linux as the operating system for their projects, knowing that support is built-in and official.
  3. Benefits for the embedded and industrial worldIndustries such as industrial automation, automotive and robotics will benefit from a Linux kernel with real-time support, improving the reliability and performance of their critical applications.
  4. Potential Side Effects for Desktops: Although PREEMPT_RT is primarily intended for embedded systems and specialized applications, its inclusion in the mainline kernel may have implications for desktop users as well. However, enabling it on desktop or laptop devices is not recommended, as it may lead to inefficiencies or resource management issues, as highlighted in several analyses.

Realtime predecessors like QNX

Before the inclusion of PREEMPT_RT in the Linux kernel, real-time operating systems such as QNX dominated critical sectors such as automotive, robotics and industrial automation. QNX, developed since the 80s, is renowned for its reliability and ability to handle real-time operations with precision and low latency. However, with the integration of Linux Real-Time into the kernel mainline, we could see a gradual challenge to QNX's dominance in the coming years. Linux, due to its open source nature and vast development ecosystem, could offer a more flexible and customizable alternative. While QNX remains well established, Linux, with the support of a large and dynamic development community, could gain traction and, in a few years, become a preferred solution for many companies, due to its lower costs and greater scope for innovation compared to proprietary solutions such as QNX.

Conclusions

The integration of PREEMPT_RT into the Linux 6.12 kernel marks the end of a long battle that began in the early 2000s. This development not only represents a victory for the Real Time Linux project, but also opens up new possibilities for the adoption of Linux in critical sectors that require guaranteed response times and very low latencies.

For those using Linux in general desktop or server environments, this news will not have a direct impact. However, for industries that depend on real-time applications, such as automotive, industrial automation, robotics and medical devices, this inclusion represents a milestone, positioning Linux as a more robust and competitive platform in these sectors as well.

The inclusion of real-time support in the mainline Linux kernel will probably be remembered as one of the most significant developments in the evolution of Linux, an operating system that continues to prove itself versatile and capable of adapting to the most diverse needs, from everyday use to the most critical and advanced applications.

Do you have doubts? Don't know where to start? Contact us!

We have all the answers to your questions to help you make the right choice.

Chat with us

Chat directly with our presales support.

0256569681

Contact us by phone during office hours 9:30 - 19:30

Contact us online

Open a request directly in the contact area.

INFORMATION

Managed Server Srl is a leading Italian player in providing advanced GNU/Linux system solutions oriented towards high performance. With a low-cost and predictable subscription model, we ensure that our customers have access to advanced technologies in hosting, dedicated servers and cloud services. In addition to this, we offer systems consultancy on Linux systems and specialized maintenance in DBMS, IT Security, Cloud and much more. We stand out for our expertise in hosting leading Open Source CMS such as WordPress, WooCommerce, Drupal, Prestashop, Joomla, OpenCart and Magento, supported by a high-level support and consultancy service suitable for Public Administration, SMEs and any size.

Red Hat, Inc. owns the rights to Red Hat®, RHEL®, RedHat Linux®, and CentOS®; AlmaLinux™ is a trademark of AlmaLinux OS Foundation; Rocky Linux® is a registered trademark of the Rocky Linux Foundation; SUSE® is a registered trademark of SUSE LLC; Canonical Ltd. owns the rights to Ubuntu®; Software in the Public Interest, Inc. holds the rights to Debian®; Linus Torvalds holds the rights to Linux®; FreeBSD® is a registered trademark of The FreeBSD Foundation; NetBSD® is a registered trademark of The NetBSD Foundation; OpenBSD® is a registered trademark of Theo de Raadt. Oracle Corporation owns the rights to Oracle®, MySQL®, and MyRocks®; Percona® is a registered trademark of Percona LLC; MariaDB® is a registered trademark of MariaDB Corporation Ab; REDIS® is a registered trademark of Redis Labs Ltd. F5 Networks, Inc. owns the rights to NGINX® and NGINX Plus®; Varnish® is a registered trademark of Varnish Software AB. Adobe Inc. holds the rights to Magento®; PrestaShop® is a registered trademark of PrestaShop SA; OpenCart® is a registered trademark of OpenCart Limited. Automattic Inc. owns the rights to WordPress®, WooCommerce®, and JetPack®; Open Source Matters, Inc. owns the rights to Joomla®; Dries Buytaert holds the rights to Drupal®. Amazon Web Services, Inc. holds the rights to AWS®; Google LLC holds the rights to Google Cloud™ and Chrome™; Microsoft Corporation holds the rights to Microsoft®, Azure®, and Internet Explorer®; Mozilla Foundation owns the rights to Firefox®. Apache® is a registered trademark of The Apache Software Foundation; PHP® is a registered trademark of the PHP Group. CloudFlare® is a registered trademark of Cloudflare, Inc.; NETSCOUT® is a registered trademark of NETSCOUT Systems Inc.; ElasticSearch®, LogStash®, and Kibana® are registered trademarks of Elastic NV Hetzner Online GmbH owns the rights to Hetzner®; OVHcloud is a registered trademark of OVH Groupe SAS; cPanel®, LLC owns the rights to cPanel®; Plesk® is a registered trademark of Plesk International GmbH; Facebook, Inc. owns the rights to Facebook®. This site is not affiliated, sponsored or otherwise associated with any of the entities mentioned above and does not represent any of these entities in any way. All rights to the brands and product names mentioned are the property of their respective copyright holders. Any other trademarks mentioned belong to their registrants. MANAGED SERVER® is a trademark registered at European level by MANAGED SERVER SRL, Via Enzo Ferrari, 9, 62012 Civitanova Marche (MC), Italy.

Back to top