Originally posted by CochainComplex
View Post
I'm going to extend it a little though, because the reality is that in the next race, it rained the night before and the track is damp; or the crew delays a tyre change for another couple of laps; etc. The driver, having gotten away with his 160kmh cornering last time, does it again this time and finds himself in the crash barrier. THAT'S what -O3 has always meant.
Sometimes you get lucky, but sometimes you don't, and the increased risk of *being* unlucky is what makes O3 a very bad idea unless you only have to worry about a *very* small subset, like a handful of programs on a single platform. That obviously isn't true for the kernel, which obviously also doesn't have anything even remotely close to an adequate AT environment even for just current x86, let alone "legacy" x86 and ARM. How many performance regressions alone does Michael catch each year?
It's fine for people to claim that O3 doesn't randomly explode any more, but that's basically just survival bias, always has been, and would still be even if the O3 problems are only half as common as they used to be. There's just SO much code out there that the compiler generates bad output for, or has, or will in the next release, that it just doesn't make sense to invite those problems unless you have manpower to burn, and very few distros do.
Paradoxically, the kernel is in some ways one of the better places to try it, and I do agree with the sentiment that O3 is potentially being pushed aside for the wrong REASONS, even if doing so is the right OUTCOME. It's likely that O3 *is* fine for most users on x64 - but we also know that it has basically no benefit, and *some* of us know that there's a lot more to the world than the specific CPU in one person's PC and the current release of one compiler.
Even so though, the whining over the implementation specifics is unbelievable. It's not like Linus is going out of his way to make it even *nontrivial* to build -O3, let alone impossible. O3 is a second-class case for good reason, and seeing non-developer forum warriors try to position themselves as somehow better informed than kernel devs is just cringe-inducing. Basement-dwellers struggling with inferiority complexes and trying to imagine they have some sort of secret knowledge that the sheeple lack and a mythical enemy is trying to suppress is the stuff of cults, not software development.
The naivety of the idea that when people run into the bugs with O3 they should burn days or weeks of their time trying to get them fixed is similarly entitled and depressing, and you can tell they've never actually done it themselves. They seem to think the GCC team spend their days just waiting for bug emails to arrive, have no backlog, will understand the bug AND the cause immediately, can fix it immediately, and will release a new version of the compiler the following day. Every step of that process takes at least one order of magnitude longer than it apparently does in their imagination, and most will be closer to two. (Oh, and also that the team never has to deal with incorrect bug reports from people who are still learning the language, which for C++ is a LOT of people with a LOT of "unexpected" behavior).
Over time, code gets littered with "#if (CC_VERSION >= x) && (CC_VERSION <= y)", not for *capabilities* like new language features, but just to workaround compiler bugs. Likewise with assorted pragmas to control optimization level for specific functions, or the same thing in makefiles. All of this comes at a cost, and it's no surprise that those who are always shouting the loudest in threads like this are also overwhelmingly the ones who've never had to bear that cost. Somehow, these "experts" insistent on O3 being the default are the same ones who find having to use KCFLAGS too much of a hurdle. The mind boggles...
All of this noise over a *1%* improvement - in *benchmarks*, not even daily workloads.
Millions of users, and millions of servers supporting billions of users, are not a f**king playground to beta-test with just to satisfy some random child's idea that the world revolves around them.
If someone enjoys rebuilding the kernel on a daily basis with different flags, I am absolutely in favor of that. There are plenty of worse hobbies to have. But from the perspective of "put up or shut up", since they've repeatedly failed to failed to manage the first part we'd all be a lot better off if they at least adopted the second part.
Leave a comment: