Re: [linus:master] [x86/syscall] 1e3ad78334: will-it-scale.per_process_ops 1.4% improvement

From: Josh Poimboeuf
Date: Fri Apr 19 2024 - 03:33:54 EST


On Fri, Apr 19, 2024 at 01:49:26PM +0800, kernel test robot wrote:
> Hi Linus,
>
> We noticed that commit 1e3ad78334a6 caused performance fluctuations in
> various micro benchmarks. The perf stat metrics related with branch
> instructions do have noticeable changes, which may be an expected
> result of this commit. We are sending this report to provide these data
> and hope it can be helpful for the awareness of overall impact or any
> further investigation. Thanks.
>
> kernel test robot noticed a 1.4% improvement of will-it-scale.per_process_ops on:
>
> commit: 1e3ad78334a69b36e107232e337f9d693dcc9df2 ("x86/syscall: Don't force use of indirect calls for system calls")
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master

Thanks, these are significant regressions.

Since this is on Skylake (with IBRS enabled, presumably) I'd expect that
these regressions are fixed by my "Only harden syscalls when needed"
patch. I'm planning on posting a new version of that tomorrow, but v3
[*] should be good enough to fix it. Could you run these tests on the
same Skylake system with my patch added?

Also it would be helpful to see the same tests on Cascade/Ice Lake, or
some other system for which the 'spectre_v2' sysfs vulnerabilities file
shows "BHI: SW loop". On such a system it shouldn't matter whether my
patch is added as it won't disable Linus' syscall change. But it would
be very helpful to see the performance impact of that combination.

[*] https://lkml.kernel.org/lkml/eda0ec65f4612cc66875aaf76e738643f41fbc01.1713296762.git.jpoimboe@xxxxxxxxxx

--
Josh