NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
20 years later, real-time Linux makes it to the kernel (zdnet.com)
teleforce 17 hours ago [-]
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

ahazred8ta 1 hours ago [-]
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.
tetris11 5 hours ago [-]
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`
Tomte 2 hours ago [-]
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...
zaptheimpaler 17 hours ago [-]
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...

viraptor 17 hours ago [-]
> Is there any reason to not just have RT on by default?

It's a latency vs throughput trade-off usually. Ideally you'd want both to improve, but the more you switch between the processes, the more time you waste on busywork and cache invalidation rather than what the processes want to achieve. For example if RT wants to guarantee that your audio is more in sync, you're going to switch from your app to the audio system more often.

cwillu 16 hours ago [-]
That's a bit of a red-herring though, as the audio system will only preempt other processes if it's configured for very small buffers and given real-time permissions. A server's audio subsystem won't preempt actual work because a server won't _have_ an audio subsystem running, let alone be configured for sub-millisecond latency.

The real trade-off is the overhead required to make all kernel operations potentially safe WRT maximum wait times.

viraptor 16 hours ago [-]
This is a qualified example. Yes, if you're not doing audio, audio is not going to interrupt. But that's a moot point...
Animats 19 hours ago [-]
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.

goodcanadian 17 hours ago [-]
Real-time Linux used to be a joke, but apparently now it works.

When was that? I used it over a decade ago, and it worked pretty well even then.

akikoo 5 hours ago [-]
Here's when:

https://help.ubuntu.com/community/UbuntuStudio/RealTimeKerne...

> Security Implications

> All it would take is one malicious process to execute and take advantage of the real-time code to completely lock-out a user from their machine, turning that machine into part of a botnet or other malicious purpose. Real-Time processes have the potential to completely take-over a machine. This is the number one reason Ubuntu does not carry a Real-Time kernel.

PhilipRoman 3 hours ago [-]
>completely lock-out a user from their machine, turning that machine into part of a botnet or other malicious purpose

There seems to be a pretty big leap from beginning of that sentence to the end, I personally wouldn't consider local DoS a problem.

londons_explore 18 hours ago [-]
> 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?

oasisaimlessly 1 hours ago [-]
I would assume it means something a bit weaker: that all critical sections have a bounded length, being guaranteed to end after a given finite number of clock cycles.
nirav72 12 hours ago [-]
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.
skovati 12 hours ago [-]
If you haven't already, look into the avionics and flight software of the Ingenuity helicopter. First time Linux ran on Mars!
16 hours ago [-]
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 16:25:17 GMT+0000 (UTC) with Wasmer Edge.