@ptesarik@infosec.exchange
@mpdesouza@floss.social How's popcorn? Here's more info:
The issue is not really a difference between the two kernel versions, but the compiler used to build them. SLE15 SP6 kernels (6.4) are built with GCC7, but SLE16 kernels (6.12) are built with GCC13. I rebuilt the SLE15 SP6 kernel with GCC13, and performance drops by more than 4%!
GCC7 produces this:
Samples β
β ffffffff81610ee0 :
β mov %rdx,%rax
β xor %ecx,%ecx
β add %rsi,%rax
156 β setb %cl
β test %rax,%rax
β β js 26
β test %rcx,%rcx
β β jne 26
932 β stac
β mov %rdx,%rcx
2092 β rep movsb %ds:(%rsi),%es:(%rdi)
β NOP3
2 β mov %rcx,%rdx
1049 β clac
β26: mov %edx,%eax
524 β β ret
GCC13 produces this:
Samples β
β ffffffff81606120 :
β mov %rdx,%rax
β mov %rdx,%rcx
β xor %edx,%edx
78 β add %rsi,%rax
β setb %dl
β test %rax,%rax
β β js 23
β test %rdx,%rdx
β β jne 23
1059 β stac
2651 β rep movsb %ds:(%rsi),%es:(%rdi)
β NOP3
1509 β clac
β23: mov %ecx,%eax
779 β β ret
However, it's not quite clear to me why the latter code is slower.
Cc: @gnutools@fosstodon.org
@ljs@mastodonapp.uk
@ptesarik@infosec.exchange @mpdesouza@floss.social @gnutools@fosstodon.org
FYI @amonakov@mastodon.gamedev.place