mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Hardware (https://www.mersenneforum.org/forumdisplay.php?f=9)
-   -   Spectre-V2 mitigation imposes HUGE performance hit (https://www.mersenneforum.org/showthread.php?t=27658)

tServo 2022-03-16 17:23

Spectre-V2 mitigation imposes HUGE performance hit
 
The most recent Gamermeld on Youtube had some frightening news about the mitigation patches to correct the Spectre-v2 hardware flaw. They say it may impose as much as a 54% reduction in performance !! This was on a Ryzen chip running a "stress test like Prime95" !
Hopefully, their patches will be revised to take less than a pound of flesh out of the CPUs.


goto 4:46 in this video


[URL]https://www.youtube.com/watch?v=Ypk8Htny95A[/URL]

retina 2022-03-16 17:35

Don't blindly "up"date to the latest code.

Consider if the problem actually affects you, or not, then decide.

If the concern is about remote actors exploiting something, then turn off JS. Then probably 99+% of all possible exploit vectors have been eliminated.

Mark Rose 2022-03-17 20:11

The overhead comes in context switching. That happens when you make a system call, for instance, or the OS schedules a different process to run. Prime95/mprime hardly causes any context switching.

xilman 2022-03-17 21:39

[QUOTE=Mark Rose;601955]The overhead comes in context switching. That happens when you make a system call, for instance, or the OS schedules a different process to run. Prime95/mprime hardly causes any context switching.[/QUOTE]What else in the system is doing a significant amount of context switching? In a modern OS with a graphical environment there could easily be several hundred such processes. For example:

[C]pcl@nut:~/Pictures$ ps ax | wc
308 2029 20858
pcl@nut:~/Pictures$ [/C]

just now. Not all will be active, of course but if they are taking more time, that time will come at the expense of others.

JWNoctis 2022-03-18 01:48

Considering what Meltdown/Spectre-V1 did to y-Cruncher, I wonder if [URL="http://www.numberworld.org/y-cruncher/guides/memory.html"]similar mitigations[/URL] may help. Probably not.

Most common users probably won't even have the option -not- to update, unfortunately.

Mark Rose 2022-03-19 02:24

[QUOTE=xilman;601958]What else in the system is doing a significant amount of context switching? In a modern OS with a graphical environment there could easily be several hundred such processes. For example:

[C]pcl@nut:~/Pictures$ ps ax | wc
308 2029 20858
pcl@nut:~/Pictures$ [/C]

just now. Not all will be active, of course but if they are taking more time, that time will come at the expense of others.[/QUOTE]

You can get actual stats if you like. Here is mprime on my 6 core desktop running for seven days, with a bunch of background processes like Steam, Discord, a few browser tabs, and so on running:

[C]
$ grep ctxt $(grep -l mprime /proc/*/task/*/status)
/proc/1385221/task/1385221/status:voluntary_ctxt_switches: 6
/proc/1385221/task/1385221/status:nonvoluntary_ctxt_switches: 19
/proc/1385221/task/1385227/status:voluntary_ctxt_switches: 173
/proc/1385221/task/1385227/status:nonvoluntary_ctxt_switches: 2361
/proc/1385221/task/1385228/status:voluntary_ctxt_switches: 46
/proc/1385221/task/1385228/status:nonvoluntary_ctxt_switches: 0
/proc/1385221/task/1385230/status:voluntary_ctxt_switches: 46708028
/proc/1385221/task/1385230/status:nonvoluntary_ctxt_switches: 18149858
/proc/1385221/task/1424349/status:voluntary_ctxt_switches: 35631268
/proc/1385221/task/1424349/status:nonvoluntary_ctxt_switches: 5502335
/proc/1385221/task/1424350/status:voluntary_ctxt_switches: 34736243
/proc/1385221/task/1424350/status:nonvoluntary_ctxt_switches: 4894247
/proc/1385221/task/1424351/status:voluntary_ctxt_switches: 35941275
/proc/1385221/task/1424351/status:nonvoluntary_ctxt_switches: 4776725
/proc/1385221/task/1424352/status:voluntary_ctxt_switches: 36673354
/proc/1385221/task/1424352/status:nonvoluntary_ctxt_switches: 4699693
/proc/1385221/task/1424353/status:voluntary_ctxt_switches: 36809359
/proc/1385221/task/1424353/status:nonvoluntary_ctxt_switches: 4709145
[/C]

So taking the worst, (46708028 + 18149858) / 7 / 86400 = 107 per second. That's not really a lot.

—————

Side note: looking at the mprime threads above, 1385230 is pinned to CPUs 0,6. The first core does indeed experience more interrupts. Three times the other cores, at least on my system.

—————

Compare that to a bonnie++ run, which is designed to simulate the IO of a database:

[c]
$ /usr/bin/time -v bonnie++ 2> >(grep -P '(context|seconds)')
Version 1.98 ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Name:Size etc /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
deadbeef 128448M 378k 99 202m 22 254m 36 672k 99 620m 48 +++++ +++
Latency 26170us 8075ms 16439ms 12132us 12300us 4305us
Version 1.98 ------Sequential Create------ --------Random Create--------
deadbeef -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 0 96 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++
Latency 484us 445us 468us 1255us 25us 1975us
1.98,1.98,deadbeef,1,1646462774,128448M,,8192,5,378,99,206673,22,259995,36,672,99,✄
634480,48,+++++,+++,16,,,,,30291,96,+++++,+++,+++++,+++,+++++,+++,+++++,✄
+++,+++++,+++,26170us,8075ms,16439ms,12132us,12300us,4305us,484us,445us,468us,1255us,25us,1975us
User time (seconds): 46.35
System time (seconds): 392.33
Voluntary context switches: 1647566
Involuntary context switches: 48659
[/c]

Where it experienced (1647566 + 48659) / 392.33 = 4323 context switches per second. And bonnie++ doesn't slam things as hard as other programs can.


All times are UTC. The time now is 16:31.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.