KPTI + Retpoline Linux Benchmarking On Older Clarksfield / Penryn ThinkPads
Over the past week and a half of running many benchmarks looking at the performance impact of the Linux KPTI and Retpoline patches for Spectre and Meltdown mitigation, one of the most common test requests is some thorough benchmarks on older systems. Why that's important is with older (pre-Westmere) CPUs there isn't PCID (Process Context Identifier) support that's used by KPTI, which helps offset some of the performance loss. So for some test results to share today are two old ThinkPads from the Clarksfield and Penryn days compared to a newer Broadwell ThinkPad in looking at the performance difference.
The PCID - Process Context Identifier - support frequently talked about now following the KPTI patches is present with Intel CPUs since the Westmere launch in 2010. If you want to learn more about the inner-workings of PCID, there's this great and thorough explanation here. It was only with Linux 4.14 that the kernel squared away its PCID support, just in time for this flurry of kernel activity around Meltdown.
When it comes to pre-PCID hardware, the only systems I have that are still accessible and not boxed up or broken are some older ThinkPads, that thanks to the great build quality are still dependable and capable of handling some benchmarks in 2018. First up was a Lenovo ThinkPad T61 with an Intel Core 2 Duo T9300 "Penryn" CPU with 4GB of RAM and a 100GB Hitachi HDD.
The second vintage ThinkPad for testing was a Lenovo ThinkPad W510 from 2009 with an Intel Core i7 720QM "Clarksfield" processor with 4GB of RAM and a 160GB Fujitsu HDD. You can easily check for the presence of PCID support on your processor by looking at the flags outputted via /proc/cpuinfo for pcid.
Then for a modern ThinkPad with PCID capabilities was the Lenovo ThinkPad X1 Carbon. This X1 Carbon has the Core i7 5600U "Broadwell" CPU with 8GB of RAM and a 128GB Samsung SSD.
All three Linux laptops were running Ubuntu 17.10 x86_64 with the GNOME Shell, GCC 7.2 and Mesa 17.2.2. With each laptop a stock Linux 4.14.0 kernel was tested (prior to Meltdown and Spectre going into the public spotlight) and then using a Linux 4.14 kernel build containing the mainlined Kernel Page Table Isolation (KPTI) support and the yet-to-be-mainlined Retpoline (v5) patches. The kernel configurations were the same between kernels besides CONFIG_RETPOLINE and CONFIG_PAGE_TABLE_ISOLATION.
A range of benchmarks were carried out with the Phoronix Test Suite. With the number of results, using OpenBenchmarking.org the results were plotted side-by-side and then normalized against the stock Linux 4.14 kernel results for showing the relative impact of KPTI + Retpoline support on each of the kernels.