2

So I recently (early January, 2018) received a kernel update to my Fedora 26 laptop which includes the KPTI kernel fixes which correct the Meltdown bug. I have been hearing a lot of speculation about the impact of these fixes to Linux systems; indeed Intel seems to believe that the emperor remains fully clothed. As seen in that link, some sources in the industry (notably Apple, Microsoft, Amazon, and Google) claim negligible impact See also this link. Others claim tremendous impact.

Not content with the confusion I've seen in the press reports, I wonder, "What will be the real impact to my machine?" I ask. Theoretically, CPU-bound processes will have negligible impact, while processes performing a lot of system calls (disk or network i/o, for example) will see more of a hit.

I answer myself below.

P.S. I have yet to see benchmarks for more modern processors; that would be very interesting, as I have heard said that "...the newer processors don't have a huge loss." Which processors are those, and how not-huge is not huge? I have an older Lenovo Thinkpad T430S with an Intel i5-3210m dual core (2 threads per core) processor. With respect to Meltdown and its fixes, is that modern, or not? According to Microsoft, "...(it) said that consumer devices with processors from 2015 or earlier running Windows 7, 8, and 10 would be more likely to exhibit slowdowns." But Intel's own benchmarks don't appear to show a difference between 2015 and 2017-era processors

  • Your i5-3210M is “old” with respect to KPTI. To reduce the impact you need PCID with INVPCID (Haswell and later). Skylake and later Intel CPUs handle KPTI better still. – Stephen Kitt Jan 16 '18 at 7:02
  • @StephenKitt that's the claim, but I would love to see comparative benchmarks. The spin, as I have seen, is that "hey- if you've got more modern stuff, you can relax." But Intel's own benchmark report to which I've linked, shows 2-14% impact vs. a non-mitigated system on a Coffee Lake proc. My testing shows a 7% impact on gcc for my older Ivy Bridge processor. So I'm not at all sure that Skylake and later handle KPTI any better than anything else. Theoretically, yes. But in the real world? – Mike S Jan 16 '18 at 14:21
2

Before I booted into the new kernel, I wanted to get some real numbers. I upgraded my kernel from 4.14.8 to 4.14.11. The latter includes the KPTI fixes for the Meltdown vulnerability. I have an older Lenovo Thinkpad T430S with an Intel i5-3210m dual core (2 threads per core) processor. The results were interesting so I thought I'd post them here.

I performed three benchmarks:

Results are below. Besides some suprising values (Auxiliary Loops/second and Directory Operations AIM9 benchmarks, block Sequential Output bonnie++ benchmark all showed better performance), the system seems to have taken a bit of a hit. I find the gcc compile to be rather interesting, as a compile involves both a lot of file i/o and CPU operations as well. Those things are similar to tasks I may often do on my machine. In any event, the 3 sets of benchmarks all seem to agree on one thing: my system has generally taken a measurable hit since installing the KPTI Meltdown remediation kernel- even to integer and floating point operations. A compile of gcc that would have taken 160 minutes will now take me 172 minutes. Bummer.

AIM9 benchmark
AIM Independent Resource Benchmark - Suite IX v1.1, January 22, 1996
Copyright (c) 1996 - 2001 Caldera International, Inc.
All Rights Reserved

BEFORE:
Machine's name                                    : rodin
Machine's configuration                           : kernel_4.14.8-200
Number of seconds to run each test [2 to 1000]    : 10
Path to disk files                                : /var/tmp/aim9

AFTER:
Machine's name                                    : rodin
Machine's configuration                           : kernel_4.14.11-200
Number of seconds to run each test [2 to 1000]    : 10
Path to disk files                                : /var/tmp/aim9

NOTE: The AIM9 benchmark has a bug such that when compiled, will not allow one of the tests to complete. In order to get it to run, I had to change line 97 on creat-clo.c from this:

static int sigcount;           /* count of signals */

to this:

volatile static int sigcount;           /* count of signals */

Here are the results of my benchmarks:

AIM9 Benchmark
         BEFORE        AFTER Percent Change   Description
01      1.996 M      1.929 M   -3.34 Thousand Double Precision Additions/second
02      1.980 M      1.945 M   -1.75 Thousand Single Precision Additions/second
03      8.559 M      8.259 M   -3.50 Thousand Long Integer Additions/second
04      8.592 M      8.280 M   -3.63 Thousand Integer Additions/second
05      8.599 M      8.268 M   -3.85 Thousand Short Integer Additions/second
06    205400.00    190400.00   -7.30 File Creations and Closes/second
07    552330.00    384665.33  -30.35 System Allocations & Pages/second
08      2.844 M      1.373 M  -51.71 System Memory Allocations/second
09     75.980 M     74.623 M   -1.78 Non-local gotos/second
10      1.131 M    651400.00  -42.43 Signal Traps/second
11       855.64       787.71   -7.93 Program Loads/second
12      3246.75      3846.15   18.46 Task Creations/second
13    166307.40    154135.80   -7.31 Link/Unlink Pairs/second
14    504839.16    369664.00  -26.77 Random Disk Reads (K)/second
15    451072.00    339628.37  -24.70 Random Disk Writes (K)/second
16      3.285 M      1.765 M  -46.24 Sequential Disk Reads (K)/second
17    698880.00    598528.00  -14.35 Sequential Disk Writes (K)/second
18    537088.00    431616.00  -19.63 Disk Copies (K)/second
19       115.78       116.58     .69 Sync Random Disk Writes (K)/second
20       116.42       114.75   -1.43 Sync Sequential Disk Writes (K)/second
21       116.05       114.90    -.99 Sync Disk Copies (K)/second
22     79020.00     73711.29   -6.71 Directory Searches/second
23    311100.00    299400.00   -3.76 Thousand Double Precision Divides/second
24    316483.52    305694.31   -3.40 Thousand Single Precision Divides/second
25    105284.72    101688.31   -3.41 Thousand Long Integer Divides/second
26    294660.00    286470.00   -2.77 Thousand Integer Divides/second
27    290700.00    282420.00   -2.84 Thousand Short Integer Divides/second
28    424.140 M    407.756 M   -3.86 Function Calls (no arguments)/second
29    462.336 M    448.460 M   -3.00 Function Calls (1 argument)/second
30    485.198 M    472.115 M   -2.69 Function Calls (2 arguments)/second
31    236.441 M    226.969 M   -4.00 Function Calls (15 arguments)/second
32       195.30       186.63   -4.43 Integer Sieves/second
33      1.202 M      1.160 M   -3.48 Thousand Double Precision Multiplies/second
34      1.204 M      1.166 M   -3.18 Thousand Single Precision Multiplies/second
35      1.396 M      1.359 M   -2.69 Thousand Long Integer Multiplies/second
36      1.396 M      1.357 M   -2.83 Thousand Integer Multiplies/second
37      1.365 M      1.327 M   -2.78 Thousand Short Integer Multiplies/second
38    554540.00    538080.00   -2.96 Numeric Functions/second
39      1.614 M      1.561 M   -3.28 Zeros Found/second
40      2.513 M      2.431 M   -3.28 Trigonometric Functions/second
41     18.605 M     17.861 M   -4.00 Point Transformations/second
42      3880.00      3766.00   -2.93 Linear Systems Solved/second
43     28060.00     26980.00   -3.84 String Manipulations/second
44     14.751 M     14.373 M   -2.55 Dynamic Memory Operations/second
46      5277.00      5121.00   -2.95 Sort Operations/second
47      4231.00     10771.00  154.57 Auxiliary Loops/second
48      2.828 M      2.900 M    2.54 Directory Operations/second
49       137.36       156.70   14.07 Shell Scripts/second
50       137.16       157.64   14.93 Shell Scripts/second
51       137.60       161.90   17.65 Shell Scripts/second
52     44.497 M     42.774 M   -3.87 Series Evaluations/second
53      1.092 M    607030.00  -44.43 Shared Memory Operations/second
56      1.318 M    825670.00  -37.38 FIFO Messages/second
57    922370.00    664690.00  -27.93 Stream Pipe Messages/second
58    866290.00    632950.00  -26.93 DataGram Pipe Messages/second
59      1.922 M      1.038 M  -45.96 Pipe Messages/second
60  19725.935 M  18947.483 M   -3.94 Memory to Memory Copy/second

=========================================================================================================
GCC compile, both "configure" and "make"
Results summary::
configure: 38% real slowdown

make (x86_64 only): 7.7% real slowdown, 5.5% user CPU slowdown

    BEFORE                                         AFTER
time ../gcc-7.2.0/configure --disable-multilib | time ../gcc-7.2.0/configure --disable-multilib
 ...                                           | ...   
configure: creating ./config.status            | configure: creating ./config.status
config.status: creating Makefile               | config.status: creating Makefile
                                               |
real    0m2.467s                               | real    0m3.420s      
user    0m1.835s                               | user    0m1.936s      
sys     0m1.108s                               | sys     0m1.295s      
                                               |
time make                                      | time make
...                                            | ...     
real    160m8.766s                             | real    172m28.158s
user    152m11.430s                            | user    163m34.790s      
sys     6m41.507s                              | sys     7m5.214s     

=========================================================================================================
BONNIE++
Version: 1.97
See https://www.coker.com.au/bonnie++/experimental/ . This version was provided by my Fedora distribution.

Run using: bonnie++ -n 1024

Sample results:
                                BEFORE          AFTER           % change from before
Sequential Output, per char     1115 K/s        890 K/s         -20
Sequential Output, block        358891 K/s      461208 K/s      +28
Sequential Input, per char      4181 K/s        1989 K/s        -52
Sequential Input, block         515347 K/s      521646 K/s      -1,2
Random Seeks                    5651 /s         5221 /s         -7.6
Sequential Create, Create       41855 /s        40751 /s        -2.74
                   Read         741945 /s       624554 /s       -15.8
                   Delete       79832 / s       78340 /s        -1.9
Random Create,     Create       41198 /s        41003 /s        -0.47
                   Read         741945 /s       719494 /s       -3.02
                   Delete       61154 /s        60698 /s        -0.74

Bonnie Results are available at:

Before: https://bintray.com/greygnome/generic/download_file?file_path=bon_results_before_kpti.html

After: https://bintray.com/greygnome/generic/download_file?file_path=bon_results_after_kpti.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.