by JoshTriplett · 11y ago · 0 comments
I'm giving the stated reasons for why Linux intentionally has no stable in-kernel ABI, and what some of the downsides of having one are. That's not an anecdote, that's a description of the stated design philosophy (see also https://www.kernel.org/doc/Documentation/stable_api_nonsense... ). You gave exclusively upsides to having a stable ABI, as though it was an obvious design failing of the Linux kernel, rather than a tradeoff.
To be clear: I absolutely agree that it's possible to provide driver interfaces that don't change; as you said, systems like Windows provide evidence of that. But that doesn't come without a cost.
But I'd be happy to be proven wrong; just point to the source code of one of the kernels you mentioned where they implement a stable kernel ABI without any accumulated cruft...oh, wait. ;)
> And note I never said that you have to maintain ABI/API compatibility forever. Even operating systems with stable API/ABIs do change them from major release to major release.
You gave no indication that you ever considered it acceptable to break ABI. I'm certainly in agreement that ABI shouldn't be broken gratuitously for its own sake; however, it shouldn't be necessary when making a change to the kernel to think about whether out-of-tree drivers (that nobody can see the code of) depend on the behavior of a particular function call, or the layout of a data structure, or the context a given function can be called in.
> So in other words, there's a genuine need for a stable API/ABI and RedHat supports it
For RedHat paying customers who intentionally want to run the same software for 5+ years at a time and avoid any changes, sure. It makes no sense for the upstream Linux kernel to give those same guarantees while doing active development. 5 years ago was roughly 2.6.36. That's 5 years and ~24 kernel releases where not a single field can be added or removed from a data structure, no argument can be added or removed for an existing function, and semantics like "what lock do you need to hold to call this function" cannot change. (There's a lot more to ABI than just function calls and data structures, particularly when you're talking about a C ABI between privileged code running in the same address space.) Maintaining compatibility like that would completely hamstring day-to-day development.
If you have that kind of compatibility requirement for a kernel, and that kernel remains under active development (rather than being declared done and untouchable, which is another option used for some embedded systems or microkernels), you'd need to heavily rework your architecture and development processes to insulate the actively-developed kernel from the drivers, generally by introducing something like a HAL, so that the kernel can change as long as it exposes a compatible HAL. Then you get into issues like HAL versioning, including potentially supporting multiple versions at once, interactions between drivers and interfaces provided by one driver to another, and so on. All for the sake of offering better support for drivers that refuse to submit their code to the upstream Linux kernel.
So yeah, it's possible to build a kernel that provides interfaces that drivers can rely on across many versions. Not without a cost, though.
So yeah, it's possible to build a kernel that provides
interfaces that drivers can rely on across many versions.
Not without a cost, though.
Software engineering is all about tradeoffs and making the right ones, I feel the Linux kernel community has made the wrong one by forcing those costs onto users instead of helping absorb some of that themselves.I never said it was free or that there wasn't a cost; I just said that usability is important and have implied the Linux kernel developers should care more than they do now.
For one example, adopting the AMD64 architecture proceeded significantly faster on Linux systems because nobody had to wait for binary drivers to become available, thus enabling end users to use their shiny new hardware to the fullest extent.
For another, do you believe that the effort to add real-time capabilities to Linux would have any chance at all at succeeding while being constrained by stable internal ABIs?
Basically only GPU drivers are sufficiently complex that the vendors are actually concerned about protecting their IP investment there and release only binary drivers; though AMD has even figured out recently that they can open source the kernel part of their GPU driver since all the interesting stuff is happening in user-space.
Are driver ABIs of other kernels actually stable across major versions, in all cases? Another comment of yours says this is not the case.
One major difference here is that there's a new release of Linux with substantial new features every 3 months, whereas new releases of NT come out every 3-6 years, and the gap is even larger for Solaris.
Another major difference is that the upstream Linux kernel doesn't have paying customers; products like RHEL and SLES do, and maybe that is the level at which things like driver ABI guarantees should be provided, if there is actual demand for it.
On the flip side, users running up-to-the-minute distributions don't necessarily care, and in fact care more about some of the properties that a stable upstream kernel ABI would trade away.
More importantly, if a stable ABI does not exist upstream, a downstream distro can add it. But if a stable ABI exists upstream, a downstream distro can't get the traded-away benefits back.