TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Real-time Linux is officially part of the kernel

503 点作者 jonbaer8 个月前

17 条评论

jpfr8 个月前
This is a big achievement after many years of work!<p>Here are a few links to see how the work is done behind the scenes. Sadly arstechnica has only <i>funny</i> links and doesn&#x27;t provide the actual source (why LinkedIn?).<p>Most of the work was done by Thomas Gleixner and team. He founded Linutronix, now (I believe) owned by Intel.<p>Pull request for the last printk bits: <a href="https:&#x2F;&#x2F;marc.info&#x2F;?l=linux-kernel&amp;m=172623896125062&amp;w=2" rel="nofollow">https:&#x2F;&#x2F;marc.info&#x2F;?l=linux-kernel&amp;m=172623896125062&amp;w=2</a><p>Pull request for PREEMPT_RT in the kernel config: <a href="https:&#x2F;&#x2F;marc.info&#x2F;?l=linux-kernel&amp;m=172679265718247&amp;w=2" rel="nofollow">https:&#x2F;&#x2F;marc.info&#x2F;?l=linux-kernel&amp;m=172679265718247&amp;w=2</a><p>This is the log of the RT patches on top of kernel v6.11.<p><a href="https:&#x2F;&#x2F;git.kernel.org&#x2F;pub&#x2F;scm&#x2F;linux&#x2F;kernel&#x2F;git&#x2F;rt&#x2F;linux-rt-devel.git&#x2F;log&#x2F;?h=v6.11-rt7-rebase" rel="nofollow">https:&#x2F;&#x2F;git.kernel.org&#x2F;pub&#x2F;scm&#x2F;linux&#x2F;kernel&#x2F;git&#x2F;rt&#x2F;linux-rt-...</a><p>I think there are still a few things you need on top of a vanilla kernel. For example the new printk infrastructure still needs to be adopted by the actual drivers (UART consoles and so on). But the size of the RT patchset is already much much smaller than before. And being configurable out-of-the-box is of course a big sign of confidence by Linus.<p>Congrats to the team!
评论 #41599644 未加载
评论 #41599891 未加载
femto8 个月前
If you want to see the effect of the real-time kernel, build and run the cyclictest utility from the Linux Foundation.<p><a href="https:&#x2F;&#x2F;wiki.linuxfoundation.org&#x2F;realtime&#x2F;documentation&#x2F;howto&#x2F;tools&#x2F;cyclictest&#x2F;start" rel="nofollow">https:&#x2F;&#x2F;wiki.linuxfoundation.org&#x2F;realtime&#x2F;documentation&#x2F;howt...</a><p>It measures and displays the interrupt latency for each CPU core. Without the real-time patch, worst case latency can be double digit milliseconds. With the real-time patch, worst case drops to single digit microseconds. (To get consistently low latency you will also have to turn off any power saving states, as a transition between sleep states can hog the CPU, despite the RT kernel.) Cyclictest is an important tool if you&#x27;re doing real-time with Linux.<p>As an example, if you&#x27;re doing processing for software defined radio, it&#x27;s the difference between the system occasionally having &quot;blips&quot; and the system having rock solid performance, doing what it is supposed to every time. With the real time kernel in place, I find I can do acid-test things, like running GNOME and libreoffice on the same laptop as an SDR, and the SDR doesn&#x27;t skip a beat. Without the real-time kernel it would be dropping packets all over the place.
评论 #41598273 未加载
评论 #41599870 未加载
评论 #41602272 未加载
cwillu8 个月前
Without the RT patchset, I can run one or two instruments at a 3ms latency, if I don&#x27;t do anything else at all on my computer.<p>With it, I routinely have 6 instruments at 1ms, while having dozens of chrome windows open and playing 3d shooters without issue.<p>It&#x27;s shocking how much difference it makes over the regular (non-rt) low latency scheduler.
评论 #41597945 未加载
评论 #41597391 未加载
评论 #41597405 未加载
miki1232118 个月前
Are there any good resources on how this kind of real-time programming is done?<p>What goes into ensuring that a program is actually realtime? Are there formal proofs, or just experience and &quot;vibes&quot;? Is realtime coding any different from normal coding? How do modern CPU architectures, which have a lot of non-constant time instructions, branch prediction, potential for cache misses and such play into this?
评论 #41596882 未加载
评论 #41596927 未加载
评论 #41596856 未加载
评论 #41597736 未加载
评论 #41597911 未加载
评论 #41597775 未加载
评论 #41598386 未加载
评论 #41596740 未加载
评论 #41601144 未加载
评论 #41596859 未加载
评论 #41599430 未加载
评论 #41597894 未加载
torginus8 个月前
I remember trying to use Linux for real time stuff in the mid 2000s, and all real-time Linuxes were very hacky and obviously out of tree - with the common solution of achieving real time behavior was hosting Linux as a process inside a true real time microkernel.<p>Afaik, the reason why real time Linux was considered impractical was to have hard RT guarantees, you needed to ensure that ALL non-preemptable sections in the kernel had bounded runtime, which was a huge burden for a fairly niche use case.<p>I wonder how they got around this requirement, or if they didn&#x27;t, did they rewrite everything to be compliant to this rule?<p>Also, does this means that Linux supports priority inversion now?
评论 #41603941 未加载
jovial_cavalier8 个月前
A few months ago, I played around with a contemporary build of preempt_rt to see if it was at the point where I could replace xenomai. My requirement is to be able to wake up on a timer with an interval of less than 350 us and do some work with low jitter. I wrote a simple task that just woke up every 350us and wrote down the time. It managed to do it once every 700us.<p>I don&#x27;t believe they&#x27;ve actually made the kernel completely preemptive, though others can correct me. This means that you cannot achieve the same realtime performance with this as you could with a mesa kernel like xenomai.
评论 #41601169 未加载
评论 #41596752 未加载
kristoffer8 个月前
&quot;Torvalds wrote the original code for printk, a debugging tool that can pinpoint exact moments where a process crashes&quot;<p>A debugging tool? I do like printk debugging but I am not sure about that description :-)
评论 #41604784 未加载
评论 #41599046 未加载
alangibson8 个月前
This is big for the CNC community. RT is a must have, and this makes builds that much easier.
评论 #41596828 未加载
评论 #41598503 未加载
glhaynes8 个月前
Very cool! How is this &quot;turned on&quot;? Compile-time&#x2F;boot-time option? Or just a matter of having processes running in the system that have requested timeslice&#x2F;latency guarantees?
评论 #41597916 未加载
评论 #41597463 未加载
eqvinox8 个月前
Amazing!<p>But:<p>&gt; worst-case latency timings a real-time Linux provides are quite useful to, say, the systems that monitor car brakes<p>I really hope my car brakes don&#x27;t run Linux ;D …<p>(they should be running something that has a formal proof of correctness, which is outside the scope of realistically possible for Linux or any other &quot;full-scale&quot; OS)<p>(pretty sure the article author came up with that example and no Linux kernel developer is aiming for car brakes either. Same for large CNC machines - they can kill and have killed people.)
评论 #41603088 未加载
ChrisArchitect8 个月前
[dupe]<p>More discussion: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=41584907">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=41584907</a>
GeorgeTirebiter8 个月前
What is the time from a GPIO transition to when the 1st instruction of my service routine executes?
AzzyHN8 个月前
For a desktop user, what&#x27;s the downside to using a realtime kernel vs the standard one?
评论 #41599013 未加载
评论 #41598980 未加载
评论 #41601143 未加载
taeric8 个月前
Sounds exciting. Anyone recommend a good place to read what the nuances of these patches are? The zdnet link about the best, at the moment?
评论 #41597325 未加载
netdur8 个月前
TL;DR: Real-time Linux finally merged into mainline after 18+ years. Good for robots, not your desktop.<p>Real-time kernel ELI5: It&#x27;s like a super punctual friend who always shows up exactly when they say they will, even if it means they can&#x27;t do as many things overall.<p>Key points:<p>- Guarantees worst-case execution times<p>- Useful for stuff like lasers, car brakes, Mars rovers<p>- Been around forever as patches, now official<p>- Linus quote from 2006: &quot;Controlling a laser with Linux is crazy, but...&quot;<p>Honestly, this won&#x27;t change much for most of us. Your Firefox tabs aren&#x27;t suddenly going to be more responsive. But it&#x27;s a big deal for embedded systems and industrial applications. Interesting tidbit: Ubuntu started offering a &quot;real-time&quot; distro last year, but you needed a Pro subscription. Wonder how this will affect that business model.<p>Personal take: It&#x27;s cool to see Linux continue to evolve and become more versatile. But I can&#x27;t help but wonder if we&#x27;re hitting diminishing returns on kernel features. Maybe the next big innovations will be at higher layers of the stack?<p>Anyone here actually using real-time Linux in production? Would love to hear some war stories.
评论 #41596340 未加载
评论 #41596304 未加载
评论 #41596185 未加载
评论 #41596663 未加载
评论 #41596517 未加载
评论 #41596187 未加载
评论 #41596180 未加载
评论 #41603816 未加载
ksec8 个月前
Anyone knows if there is something similar for FreeBSD?
dewlinedew28 个月前
Hooray!