OpenSUSE's Spectre Mitigation Approach Is One Of The Reasons For Its Slower Performance

Written by Michael Larabel in SUSE on 14 April 2019 at 10:29 AM EDT. 70 Comments
SUSE
OpenSUSE defaults to IBRS for its Spectre Variant Two mitigations rather than the Retpolines approach and that is one of the reasons for the distribution's slower out-of-the-box performance compared to other Linux distributions.

A Phoronix reader pointed out this opensuse-factory mailing list thread citing a "huge single-core performance loss" on a Lenovo laptop when using openSUSE. There's a ~21% performance loss in single-threaded performance around the Spectre Variant Two mitigations, which itself isn't surprising as we've shown time and time again about the performance costs of the Spectre/Meltdown mitigations.

OpenSUSE's kernel is using IBRS (Indirect Branch Restricted Speculation) with the latest Intel CPU microcode images while most Linux distributions are relying upon Retpolines as return trampolines. The IBRS mitigation technique has the potential of incurring more of a performance loss than Retpolines, which has been known to incur a greater performance hit due to the more restricted speculation behavior when paired with the updated Intel CPU microcode.

Switching over to Retpolines for the workload in question restored the performance, per the mailing list discussion.

OpenSUSE users wanting to use that non-default approach can opt for it using the spectre_v2=retpoline,generic kernel command line parameter, which matches the behavior of most other Linux distributions' kernels.

As for openSUSE changing their defaults, at least from the aforelinked mailing list discussion it doesn't appear their kernel engineers have any interest in changing their Spectre mitigation default but are just blaming the poor performance on Intel as their problem.

Some have also suggested the openSUSE installer pick-up a toggle within its installer for informing users of security vs. performance preferences in better providing sane/informed defaults, but so far we haven't seen any action taken to make that happen. It would make sense though considering some of openSUSE's conservative defaults do have performance ramifications compared to most other Linux distributions, which we've shown in past benchmarks, albeit just written off by openSUSE as "mostly crap."

Previously a barrier to Retpolines usage was needing the Retpolines compiler support, but that support has now been available for quite some time. There was also reported Retpolines issues with Skylake in the past, but those appear to have been resolved as well.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week