Wed Sep 18 17:09:00 UTC 2024: ## Real-Time Linux Finally Reaches Mainline Kernel After Two Decades

**VIENNA** – After a remarkable 20-year journey, Real-Time Linux (PREEMPT_RT) has finally been merged into the mainline Linux kernel, marking a significant milestone for the open-source operating system. The integration, approved by Linus Torvalds himself, signifies a major shift in the capabilities and applications of Linux.

Real-time operating systems (RTOS) are crucial for time-critical applications, guaranteeing precise and reliable responses to events within strict time constraints. While Linux has traditionally been known for its general-purpose applications, the PREEMPT_RT patch set has been a long-standing effort to empower Linux with real-time capabilities.

“Real-time is the fastest worst-case scenario,” explains Steven Rostedt, a prominent real-time Linux developer and Google engineer. This means that RTOS’s core focus is on deterministic behavior, ensuring critical tasks are completed within specified deadlines, making them essential for industries like industrial control systems, medical devices, and aerospace equipment.

The journey of real-time Linux began in the late 1990s, with early efforts focusing on separate real-time kernels running alongside the standard Linux kernel. In 2004, Ingo Molnar, a senior Linux kernel developer, spearheaded the PREEMPT_RT project, integrating real-time functionality directly into the mainline kernel.

Despite initial skepticism, the project gained traction, with companies starting to use PREEMPT_RT for industrial applications requiring millisecond precision. Over the years, many elements of PREEMPT_RT were integrated into the Linux kernel, making it more efficient and powerful.

“You don’t realize how much Linux improved because of the real-time patch,” Rostedt emphasizes. “The only reason why Linux runs in data centers today is because of the work we did.”

While the technical challenges were significant, political and financial obstacles also contributed to the lengthy integration process. The Linux Foundation established the Real-Time Linux (RTL) collaborative project in 2015 to coordinate efforts and secure funding for the project.

One of the final hurdles was addressing the print_k function, a critical debugging tool that introduces delays incompatible with real-time systems. After extensive work and negotiation, a compromise was reached, allowing for the seamless integration of PREEMPT_RT.

With the merging of PREEMPT_RT, Linux becomes fully preemptible, allowing it to respond to events within microseconds. This opens up new possibilities for Linux in the world of RTOS, making it a serious contender for time-critical applications across industries.

“This is a victory not just for real-time manufacturers but for all Linux users,” Rostedt said. “It will allow Linux to be used in even more ways than we can imagine today.” The future of Linux is bright, and with real-time capabilities now firmly established, its role in the world of technology is set to expand even further.

Read More