Re: PSA: New intel MDS vulnerability mitigations cause measurable slowdown

From: Albert Cervera i Areny <albert(at)nan-tic(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PSA: New intel MDS vulnerability mitigations cause measurable slowdown
Date: 2019-05-16 16:24:40
Message-ID: CADWJ7G=t6G0Qp9481mr8y34Ei8-286bUZTPB3_T4FhKASG3crQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Missatge de Thomas Munro <thomas(dot)munro(at)gmail(dot)com> del dia dj., 16 de
maig 2019 a les 13:09:
>
> On Wed, May 15, 2019 at 1:13 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
> > > I've run a quick pgbench benchmark:
> > >
> > > *Without* disabling SMT, for readonly pgbench, I'm seeing regressions
> > > between 7-11%, depending on the size of shared_buffers (and some runtime
> > > variations). That's just on my laptop, with an i7-6820HQ / Haswell CPU.
> > > I'd be surprised if there weren't adversarial loads with bigger
> > > slowdowns - what gets more expensive with the mitigations is syscalls.
>
> This stuff landed in my FreeBSD 13.0-CURRENT kernel, so I was curious
> to measure it with and without the earlier mitigations. On my humble
> i7-8550U laptop with the new 1.22 microcode installed, with my usual
> settings of PTI=on and IBRS=off, so far MDS=VERW gives me ~1.5% loss
> of TPS with a single client, up to 4.3% loss of TPS for 16 clients,
> but it didn't go higher when I tried 32 clients. This was a tiny
> scale 10 database, though in a quick test it didn't look like it was
> worse with scale 100.
>
> With all three mitigations activated, my little dev machine has gone
> from being able to do ~11.8 million baseline syscalls per second to

Did you mean "1.8"?

> ~1.6 million, or ~1.4 million with the AVX variant of the mitigation.
>
> Raw getuid() syscalls per second:
>
> PTI IBRS MDS=off MDS=VERW MDS=AVX
> ===== ===== ======== ======== ========
> off off 11798658 4764159 3274043
> off on 2652564 1941606 1655356
> on off 4973053 2932906 2339779
> on on 1988527 1556922 1378798
>
> pgbench read-only transactions per second, 1 client thread:
>
> PTI IBRS MDS=off MDS=VERW MDS=AVX
> ===== ===== ======== ======== ========
> off off 19393 18949 18615
> off on 17946 17586 17323
> on off 19381 19015 18696
> on on 18045 17709 17418
>
> pgbench -M prepared read-only transactions per second, 1 client thread:
>
> PTI IBRS MDS=off MDS=VERW MDS=AVX
> ===== ===== ======== ======== ========
> off off 35020 34049 33200
> off on 31658 30902 30229
> on off 35445 34353 33415
> on on 32415 31599 30712
>
> pgbench -M prepared read-only transactions per second, 4 client threads:
>
> PTI IBRS MDS=off MDS=VERW MDS=AVX
> ===== ===== ======== ======== ========
> off off 79515 76898 76465
> off on 63608 62220 61952
> on off 77863 75431 74847
> on on 62709 60790 60575
>
> pgbench -M prepared read-only transactions per second, 16 client threads:
>
> PTI IBRS MDS=off MDS=VERW MDS=AVX
> ===== ===== ======== ======== ========
> off off 125984 121164 120468
> off on 112884 108346 107984
> on off 121032 116156 115462
> on on 108889 104636 104027
>
> time gmake -s check:
>
> PTI IBRS MDS=off MDS=VERW MDS=AVX
> ===== ===== ======== ======== ========
> off off 16.78 16.85 17.03
> off on 18.19 18.81 19.08
> on off 16.67 16.86 17.33
> on on 18.58 18.83 18.99
>
> --
> Thomas Munro
> https://enterprisedb.com
>
>

--
Albert Cervera i Areny
http://www.NaN-tic.com
Tel. 93 553 18 03

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2019-05-16 16:39:47 Re: Avoiding hash join batch explosions with extreme skew and weird stats
Previous Message Darafei Komяpa Praliaskouski 2019-05-16 16:05:53 How do we support FULL JOIN on PostGIS types?