Real-time capable Linux 6.12 released
Linux now integrates PREEMPT_RT and is real-time capable. The eBPF-based "extensible scheduler" is also included.
(Image: Bild erstellt mit KI in Bing Designer durch heise online / dmk)
Linus Torvalds released the next Linux kernel in the night from Sunday to Monday. As is so often the case, well over half of the changes in Linux 6.12 concern new, adapted and extended drivers. Around a tenth of the new features concern performance and self-tests as well as other useful features from the toolbox relating to the kernel and its development. In addition, some effort went into improvements and optimizations relating to file systems. Torvalds described this as "a bit of everything" a good two months ago with the first release candidate.
Nevertheless, the new Linux kernel is anything but boring. It finally includes some long-delayed features. For example, the friction surrounding the "extensible scheduler" (sched_ext) has been resolved. The scheduler, which can be extended via eBPF, is now part of the Linux kernel. In addition, the real-time scheduler PREEMPT_RT has now arrived in the mainline kernel. It can now be activated via a config option in expert mode when configuring the Linux kernel.
Real-time has arrived in the kernel
It is nothing new that Linux is also real-time capable. In 2005, Thomas Gleixner launched PREEMPT_RT as a patch set for Linux. Since then, a steadily growing team has continuously developed real-time capability (real-time support) over two decades. With the set adapted for the respective kernel versions, "real time" could be injected into Linux. The development took place outside the official kernel sources (mainline).
Videos by heise
After navigating countless technical and political obstacles, the ceremonial and unusual handover took place on September 19 of this year. Gleixner submitted the "pull request" for the inclusion of PREEMPT_RT in the mainline kernel not only electronically via the git version management system. He also personally handed Linus Torvalds the pull request in printed form, wrapped in gold foil and tied up with a red ribbon and bow. Just as Torvalds had jokingly wished years before.
With the PREEMPT_RT in the mainline kernel, Linux is officially a real real-time operating system. It thus joins the ranks of the predominantly proprietary competition, such as the realtime veteran OS-9, QNX, which is used in automotive engineering, and VxWorks, which powers the Mars rovers Spirit, Opportunity, Curiosity and Perseverance. While the competition was designed for real-time operation right from the drawing board, Linux is a general-purpose operating system by design, which was only successfully – – retrofitted with real-time operation. In research, this was long considered almost "impossible".
What makes real-time tick?
Real-time operation means being able to process incoming information, signals or data within a defined period of time. There must be no delays. No hardware or software may "interfere" to such an extent that the agreed time frame can no longer be adhered to. As a rule, general-purpose operating systems do not meet this requirement.
A vivid example: Assume that keystrokes are information that needs to be processed. If you type nimbly and quickly using the ten-finger system, you can type smoothly on a general-purpose operating system in normal operation. The characters appear on the screen almost simultaneously with the keystroke. Now the system is reaching its performance limits because it is installing updates, generating an image without GPU support via AI and then switching to power-saving mode because the battery is running low. Then typing suddenly becomes like typing on an old 80s teletype machine. You don't even type any more, but the letters still appear on the screen.
In real-time operation, however, the keystrokes would still appear on the screen in a predefined time. This implies some changes to the system. For example, the scheduler must be modified so that it prioritizes real-time processing and is guaranteed to process the data or events in the specified time. Unlike in the general-purpose operating system –, non-prioritized processing must take a back seat and make do with the system resources left over by real-time processing. The section on "Realtime throttling" in the kernel 6.8.1 release outlines how this can also cause problems. A system can also become unmanageable in real-time operation without security measures.
Performance and power management are largely undesirable in real-time operation. Adjusting the CPU frequency or switching to a conventional sleep mode would be detrimental to real-time operation. This is where it becomes clear why there are general-purpose and real-time operating systems. No one wants to have a constantly awake energy guzzler as an office PC or notebook.
Integration in Linux
This shows how complex the conversion from Linux to real-time OS was and why it took twenty years to achieve full integration. In addition to political uncertainties, there were also many technical hurdles to overcome.
Linux 6.12 includes realtime operation for x86_64, x86, ARM64 and RISC-V. This is activated via the CONFIG_PREEMPT_RT option in make menuconfig. This means that the dormant functions in the mainline kernel that have been included in parts of PREEMPT_RT since Linux 5.10 can now also be activated.
File systems
Previously, it was possible to mount a file system under /proc. A typical example is /proc/PID/fd, where PID stands for the process ID. Linux 6.12 puts a stop to this. From now on, file systems can no longer be mounted there. On the one hand, it makes little sense to mount file systems at such a "volatile" point anyway. On the other hand, this is also a security risk.
The userspace file systems (FUSE) now also support "ID-mapped mounts". This is the basic support, the next kernel versions will add something for this. NTFS3 extends support for compressed files. XFS comes up with new ioctls to support multi-granular and fine-grained time stamps.
With the patches for "Device Memory TCP", the new kernel optimizes TCP data transfers. To this end, it uses the DMA buffer mechanism to exchange data between the network and peripheral devices without a detour via the CPU.
Rust moves forward
Work on Rust integration is making progress. In particular, Rust can now handle a range of kernel development and security features. Worth mentioning here are the connection to the "Kernel Address Sanitizer" (KASAN), Spectre Mitigation and Kernel Control Flow Integrity.
Most gcc plugins can now also be used from Rust. There are also new Rust modules for double-linked lists and red-black trees.
To summarize
Linux 6.12 is more than just a maintenance release. With the integrated extensible scheduler and real-time patching, significant new features are now standard. This facilitates the integration and maintenance of real-time kernels in distributions in particular.
Linux 6.12 also offers a number of new drivers and optimizations apart from these "chunks". A successful conclusion for this year, as the next kernel is not due until 2025. Traditionally the last release of the year, Linux 6.12 will also be the next LTS release with long-term support.
As usual, the source code for Linux 6.12 is available for download at kernel.org. All changes and new features are listed in detail in the kernel changelog.
(olb)