https://www.zdnet.com/article/20-years-later-real-time-linux-makes-it-to-the-kernel-really/ X Trending * October Prime Day 2024: Everything you need to know * Still have a Windows 10 PC? You have 5 options before support ends in 2025 * Microsoft will start charging for Windows 10 updates next year. Here's how much * I maxed out my iPhone 16 Pro Max preorder. Here's how much it cost me * Best iPhone 16 and iPhone 16 Pro cases 2024 * Apple just gave me a compelling reason to buy the smaller iPhone 16 Pro over the Max this year * * The camera I recommend to most new photographers is not a Sony * I love everything about this Android tablet (especially the price) * Best flip phones 2024 * Best Roku TVs 2024 * Best TVs under $1,000 2024 * Get an Apple Watch Series 10 for as low as $99 when you preorder at Best Buy * * How to upgrade Windows Home edition to Pro (and why you would) * How to download YouTube videos for free, plus two other methods * How to use the open-source Proton VPN browser extension * Is Temu legit? Everything to know before you place your first order * Neo QLED vs OLED: Which TV technology is right for you? * ZDNET Recommends Tech * Gaming * Headphones * Laptops * Mobile Accessories * Networking * PCs * * Printers * Smartphones * Smart Watches * Speakers * Streaming Devices * Streaming Services * * Tablets * TVs * Wearables * * Kitchen & Household * Office Furniture * Office Hardware & Appliances * Smart Home * Smart Lighting * Yard & Outdoors Innovation * Artificial Intelligence * AR + VR * Cloud * Digital Transformation * Energy * * Robotics * Sustainability * Transportation * Work Life * * Accelerate your tech game Paid Content * How the New Space Race Will Drive Innovation * How the metaverse will change the future of work and society * * Managing the Multicloud * The Future of the Internet * The New Rules of Work * The Tech Trends to Watch in 2023 Business * See all Business * Amazon * Apple * Developer * E-Commerce * * Edge Computing * Enterprise Software * Executive * Google * Microsoft * * Professional Development * Social Media * SMB * Windows * * How AI is transforming organizations everywhere * The intersection of generative AI and engineering * Software development: Emerging trends and changing roles Security * See all Security * Cyber Threats * Password Manager * Ransomware * VPN * * Cybersecurity: Let's get tactical * Securing the Cloud Advice * Deals * How-to * Product Comparisons * Product Spotlights * Reviews Buying Guides * See all Buying Guides * Best Samsung phones * Best Android phones * Best smart rings * Best blood pressure watches * Best headphones for sleeping * * Best robot vacuum mops * Best web hosting services * Best travel VPNs * Best VPNs * Best AI image generators * Best AI chatbots * * Best 75-inch TVs * Best smartphones * Best iPhones * Best MagSafe battery packs * Best digital notebooks * Best TV antennas * * Best TVs * Best laptops * Best tablets * Best smartwatches * Best headphones * Best live TV streaming services tomorrow belongs to those who embrace it today * ZDNET France * ZDNET Germany * ZDNET Korea * ZDNET Japan [ ] Go Most Popular * See all Topics * Finance * Education * Health * Special Features * ZDNET In Depth * ZDNET Recommends * Newsletters * Videos * Editorial Guidelines * Trending * October Prime Day 2024: Everything you need to know * Still have a Windows 10 PC? You have 5 options before support ends in 2025 * Microsoft will start charging for Windows 10 updates next year. Here's how much * I maxed out my iPhone 16 Pro Max preorder. Here's how much it cost me * Best iPhone 16 and iPhone 16 Pro cases 2024 * Apple just gave me a compelling reason to buy the smaller iPhone 16 Pro over the Max this year * The camera I recommend to most new photographers is not a Sony * I love everything about this Android tablet (especially the price) * Best flip phones 2024 * Best Roku TVs 2024 * Best TVs under $1,000 2024 * Get an Apple Watch Series 10 for as low as $99 when you preorder at Best Buy * How to upgrade Windows Home edition to Pro (and why you would) * How to download YouTube videos for free, plus two other methods * How to use the open-source Proton VPN browser extension * Is Temu legit? Everything to know before you place your first order * Neo QLED vs OLED: Which TV technology is right for you? * ZDNET Recommends * Tech * Gaming * Headphones * Laptops * Mobile Accessories * Networking * PCs * Printers * Smartphones * Smart Watches * Speakers * Streaming Devices * Streaming Services * Tablets * TVs * Wearables * Kitchen & Household * Office Furniture * Office Hardware & Appliances * Smart Home * Smart Lighting * Yard & Outdoors * Innovation * Artificial Intelligence * AR + VR * Cloud * Digital Transformation * Energy * Robotics * Sustainability * Transportation * Work Life * Accelerate your tech game Paid Content * How the New Space Race Will Drive Innovation * How the metaverse will change the future of work and society * Managing the Multicloud * The Future of the Internet * The New Rules of Work * The Tech Trends to Watch in 2023 * Business * See all Business * Amazon * Apple * Developer * E-Commerce * Edge Computing * Enterprise Software * Executive * Google * Microsoft * Professional Development * Social Media * SMB * Windows * How AI is transforming organizations everywhere * The intersection of generative AI and engineering * Software development: Emerging trends and changing roles * Security * See all Security * Cyber Threats * Password Manager * Ransomware * VPN * Cybersecurity: Let's get tactical * Securing the Cloud * Advice * Deals * How-to * Product Comparisons * Product Spotlights * Reviews * Buying Guides * See all Buying Guides * Best Samsung phones * Best Android phones * Best smart rings * Best blood pressure watches * Best headphones for sleeping * Best robot vacuum mops * Best web hosting services * Best travel VPNs * Best VPNs * Best AI image generators * Best AI chatbots * Best 75-inch TVs * Best smartphones * Best iPhones * Best MagSafe battery packs * Best digital notebooks * Best TV antennas * Best TVs * Best laptops * Best tablets * Best smartwatches * Best headphones * Best live TV streaming services * More * See all Topics * Finance * Education * Health * Special Features * ZDNET In Depth * ZDNET Recommends * Newsletters * Videos * Editorial Guidelines Business Home Business Enterprise Software 20 years later, real-time Linux makes it to the kernel - really The work done on real-time Linux has benefitted the open-source OS for years, but it was only this week that Linus Torvalds admitted its last piece into the mainline kernel. Exactly what took so long? steven-vaughan-nichols Written by Steven Vaughan-Nichols, Senior Contributing Editor Sept. 18, 2024 at 10:09 a.m. PT * * * * * Senior Real-Time Linux developer Steven Rostedt and Steven Vaughan-Nichols at Linux Summit Europe in Vienna. Senior Real-Time Linux developer Steven Rostedt and yours truly, Steven Vaughan-Nichols, at Linux Summit Europe in Vienna. sjvn VIENNA -- After 20 years, Real-Time Linux (PREEMPT_RT) is finally -- finally -- in the mainline kernel. Linus Torvalds blessed the code while he was at Open Source Summit Europe. Why is this a big deal? Let's start by explaining what a real-time operating system (RTOS) is and what it's good for. What is an RTOS? An RTOS is a specialized operating system designed to handle time-critical tasks with precision and reliability. Unlike general-purpose operating systems like Windows or macOS, an RTOS is built to respond to events and process data within strict time constraints, often measured in milliseconds or microseconds. As Steven Rostedt, a prominent real-time Linux developer and Google engineer, put it, "Real-time is the fastest worst-case scenario." He means that the essential characteristic of an RTOS is its deterministic behavior. An RTOS guarantees that critical tasks will be completed within specified deadlines. Many people assume that RTOSs are for fast processes. They're not. Speed is not the point in RTOSs -- reliability is. This predictability is crucial in applications where timing is essential, such as industrial control systems, medical devices, and aerospace equipment. Also: 5 Linux commands you should never run (and why) One example of real-time operating systems in use today is VxWorks, which is used in NASA's Mars rovers to guide them, and in the Boeing 787 Dreamliner aircraft to control avionics systems, ensuring real-time responsiveness for flight controls. Another example is QNX Neutrino, which is widely used in cars for infotainment, and advanced driver-assistance systems such as anti-lock brakes. Real-time Linux's history The real-time Linux code is now baked into all Linux distros as of the forthcoming Linux 6.12 kernel. This means Linux will soon start appearing in more mission-critical devices and industrial hardware. But it took its sweet time getting here. The story of real-time Linux began in the late 1990s when there was a growing need for Linux to support real-time applications. The initial efforts focused on creating separate real-time kernels that ran alongside the Linux kernel. This included academic projects such as KURT from the University of Kansas; RTAI, from the University of Milano; and New Mexico Institute of Mining and Technology's RTLinux. Ingo Molnar, a senior Linux kernel developer, started collecting and reshaping pieces of these technologies in 2004 to build the foundation for the real-time preemption patch set PREEMPT_RT. This approach was different from earlier real-time Linux solutions as it modified the existing Linux kernel rather than creating a separate real-time kernel. By 2006, it had gained enough traction that Linus Torvalds observed, "Controlling a laser with Linux is crazy, but everyone in this room is crazy in his own way. So if you want to use Linux to control an industrial welding laser, I have no problem with you using PREEMPT_RT." By 2009, a small team of kernel developers, including Thomas Gleixner, Peter Ziljstra, and Rostedt, had finished consolidating previous prototypic developments into a single out-of-tree patch set. It was then that many companies started using this patch set to build industrial systems requiring hard real-time properties with millisecond precision. Also: These Linux distributions are best for developers - here's why As the project moved forward, many elements of it moved into the kernel. Rostedt told me that, in a way, it's wrong to say that real-time is only now in Linux. Many of its features have been introduced into mainstream Linux over the years. Some of these, indeed, are essential to the Linux you use every day. For example, chances are you've never heard of "NO_HZ," which reduces power consumption in idle systems. NO_HZ is what enables Linux to run efficiently on machines with thousands of CPUs. "You don 't realize how much Linux improved because of the real-time patch," Rostedt emphasized. "The only reason why Linux runs in data centers today is because of the work we did." So, without NO_HZ, Linux wouldn't be running essentially all data centers. This, in turn, explains why Linux runs the cloud. I don 't know exactly what the world would look like without this real-time contribution, but it wouldn't look anything like it does today. Real-time Linux has also proven useful in ways no one ever dreamed of at the start. Rostedt reminiscenced, "Back in 2005, I got a real-time bug report, and I sent a patch and said, 'Hey, here's the fix. Can you apply it?' And the guy's like, 'I don& apos;t know what I'm doing.' I replied, 'Wait, aren& apos;t you a kernel developer?' He replied, 'I'm a guitarist.'" Also: Linus Torvalds muses about maintainer gray hairs and the next & apos;King of Linux' It turned out he was using the early real-time patches because he was using JACK, the sound server for low-latency audio connections. He was using it because, like most musicians, he was too broke to buy high-end gear so, Rostedt continued, "he got a cheap laptop, with Linux and JACK, because with the real-time patch it would do good recording instead of skipping when the hard drive was writing." 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 What took Real-Time Linux so long? 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." In addition, the path to the mainline wasn't just about technical challenges. Politics and perception also played a role. "In the beginning, we couldn't even mention real-time," Rostedt recalled. "Everyone said, 'Oh, we don't care about real-time.'" Another problem was money. For many years funding for real-time Linux was erratic. In 2015, the Linux Foundation established the Real-Time Linux (RTL) collaborative project to coordinate efforts around mainlining PREEMPT_RT. Also: Need to transfer files between Linux machines? Here are 5 dependable solutions 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. Also: 5 best Linux distributions for gamers in 2024 After two decades of development, the Linux real-time patch finally has been merged into the mainline kernel. This milestone marks the culmination of years of work by kernel developers to bring deterministic, low-latency performance to Linux. With it, the Linux kernel is fully preemptible, which enables it to respond to events within microseconds. This capability is crucial for applications that require precise timing, such as industrial control systems, robotics, and audio production. With the merging of the real-time patch, Linux is now poised to be a serious player in the RTOS world. This is a victory not just for real-time manufacturers but for all Linux users. Open Source 10 Linux apps I can't do without - and why Linux and open-source documentation is a mess: Here's the solution 6 ways LibreOffice is better than Google Docs for serious writing work The Linux file system structure explained * 10 Linux apps I can't do without - and why * Linux and open-source documentation is a mess: Here's the solution * 6 ways LibreOffice is better than Google Docs for serious writing work * The Linux file system structure explained Editorial standards Show Comments Log In to Comment Community Guidelines Related Linus Torvalds muses about maintainer gray hairs and the next ' King of Linux' These Linux distributions are best for developers - here's why 5 best Linux distributions for gamers in 2024 ZDNET we equip you to harness the power of disruptive innovation, at work and at home. * Topics * Galleries * Videos * Do Not Sell or Share My Personal Information * about ZDNET * Meet The Team * Sitemap * Reprint Policy * Join | Log In * Newsletters * Site Assistance * Licensing * * * * * * (c) 2024 ZDNET, A Red Ventures company. All rights reserved. Privacy Policy | | Cookie Settings | Advertise | Terms of Use