Bisected: The Unfortunate Reason Linux 4.20 Is Running Slower
Hoping it was just a simple performance regression in Linux 4.20 that could be quickly resolved, that was not the finding when bisecting these performance shortcomings... An intentional kernel change for better mitigating against Spectre is the latest reason why the Intel Linux performance is much slower. That change is "STIBP" for cross-hyperthread Spectre mitigation on Intel processors. STIBP is the Single Thread Indirect Branch Predictors (STIBP) allows for preventing cross-hyperthread control of decisions that are made by indirect branch predictors.
The Python performance is also affected by this active change on Linux 4.20.
Basically, the STIBP addition in Linux 4.20 will affect systems that have up-to-date/available microcode with this support and where your CPU has Hyper Threading enabled/present.
The PHP performance is about 30% slower with Linux 4.20 on this Core i9 box. That's on top of the performance losses seen earlier in the year with the earlier Spectre/Meltdown patches.
Keep in mind with Linux 4.19 there is already the out-of-the-box mitigations against Spectre, Meltdown, Foreshadow, etc. This performance drop with Linux 4.20 is on top of all the previously outlined performance hits this year from the security hardening.
While with time it's possible to better optimize the code to perhaps recover from some of the performance loss, with this being an intentional change, that's how things are looking for Linux 4.20 with no apparent improvement in sight. If disabling Spectre V2 mitigations for the Linux kernel, STIBP becomes disabled as a workaround for performance sensitive systems albeit potentially insecure.
Needless to say, this weekend on my benchmarking agenda are now a lot more tests of different systems as well as running a more diverse range of benchmarks to see what else is impacted by the kernel now using STIBP for furthering its Spectre Variant Two protection. As always, if you appreciate my relentless Linux benchmarking, consider showing your support with a PayPal tip or premium subscription to help facilitate this testing.
Update: Additional benchmarks including overall Spectre/Meltdown costs on Linux 4.20.
If you enjoyed this article consider joining Phoronix Premium to view this site ad-free, multi-page articles on a single page, and other benefits. PayPal or Stripe tips are also graciously accepted. Thanks for your support.