20 years later, real-time Linux makes it to the kernel

by axiomdata316on 9/18/2024, 8:14 PMwith 26 comments

by teleforceon 9/18/2024, 11:19 PM

Wow finally, it seems like yesterday when first encountered the real-time Linux kernel proposal.

It's a long time overdue and congrats to the real-time Linux time for the tenacity. The fact that it's included after eBPF being accepted to the Linux kernel but better late than never. Now we can preempt eBPF codes to make it even faster and responsive.

It will be very interesting to run real-time Linux on Raspberry Pi interfacing with Pi Pico for IoT monitoring, sensing and actuating communicating over bidirectional BiSS interface [1].

[1] BiSS: High speed open-source digital interface for IoT sensors and actuators:

https://news.ycombinator.com/item?id=41516826

by zaptheimpaleron 9/18/2024, 11:30 PM

Wow that sounds like a hell of an achievement. Here is the commit to the print_k function they mentioned as the final hurdle [1]. I have no idea what it does but maybe someone else here does. I wonder if the RT stuff will remain behind a config flag or become the default eventually. Is there any reason to not just have RT on by default?

I remember I had some nasty sound distortion issues on a Windows VFIO VM and it came down to events/interrupts not being handled quickly enough. I wonder what happens with an RT kernel and the VM thread having high priority in that situation.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...

by ttshaw1on 9/19/2024, 5:15 PM

Anyone know if this will have any impact on low-latency linux audio? The article calls out JACK, but I'd guess the new standard for musicians recording on Linux is pipewire. So if pipewire either found some workaround or has been enabling a real-time module, I suppose those end users wouldn't see a difference.

by tetris11on 9/19/2024, 11:22 AM

If anyone wants to try multiple kernels on their machine, here's how you'd do it with systemd-boot

    ## install mainline, bleeding, secure, stable, and stable realtime, mainline realtime
    pacman -S linux linux-zen linux-hardened linux-lts linux-rt-lts, linux-rt
    ## and I guess, soon to be: linux-rt
And then add the following 5 bootloader entries as separate files

    #/boot/loader/entries/linux{,-zen,-hardened,-lts,-rt-lts,-rt}.conf
    title Linux {Main,Zen,Hard,LTS,RT-LTS,RT}
    linux /vmlinuz-linux{,-zen,-hardened,-lts,-rt-lts,-rt}
    initrd /initramfs-linux{,-zen,-hardened,-lts,-rt-lts,-rt}.img
    options root=PARTUUID="the-part-uuid-of-your-root-partition" rw
and after those 5 files are in place, do a `bootctl update`

by Animatson 9/18/2024, 9:12 PM

Nice. Real-time Linux used to be a joke, but apparently now it works.

The sheer complexity of making much of kernel space preemptable is scary. There's too much running in kernel space.

by Tomteon 9/19/2024, 2:03 PM

Lots of testing (and funding, I think) by OSADL, who nobody seems to know: https://www.osadl.org/OSADL-QA-Farm-Real-time.linux-real-tim...

by londons_exploreon 9/18/2024, 10:45 PM

> the Linux kernel is fully preemptible,

So this means there are no critical sections or interrupts being disabled anywhere in kernel code when PREEMPT_RT is enabled?

by ahazred8taon 9/19/2024, 2:57 PM

A buddy of mine used Trinux RTK and Wind River RTLinux in a commercial audio console product back in the 00's. There were several efforts back then.

by nirav72on 9/19/2024, 4:07 AM

I don’t know much about RTOS. But am aware that JPL uses VxWorks for planetary rovers and orbiters. So wondering if JPL or other entities will replace VxWorks with a Linux RTOS implementation at some point.

by penguin_boozeon 9/19/2024, 6:40 PM

> Unlike general-purpose operating systems like Windows or macOS.

FYI, there appears to be minor one, too: it's called Linux.

by jellykidon 9/19/2024, 9:15 PM

I wonder if this will improve emulation compatibility?