Re:Real time Linux has one known issue remaining
by marcan_42 on Monday February 21, 2022 @09:42PM
(#30423488)
It's not impossible; Linux already has a mechanism for this (alternatives, static keys), which allows patching code at runtime. It is used precisely for this kind of thing, where you don't want the performance impact of branching every time to decide what code path to use.
However, while it can practically eliminate code overhead, it can't eliminate data overhead. I'm guessing the RT stuff does add overhead to data structures, and alternatives wouldn't fix that.
Given the performance critical nature of how this changes things I personally think it's unlikely. It does stuff like change the way spinlocks work in the Kernel which would be not only difficult, but expensive without recompilation. The best I think you'll get is a boot-time option to switch between pre-compiled kernels.
That being said, most of the RT Linux patches over the years are actually compiled in all the time anyway so a lot of these improvements have been incorporated for a long time.