I am trying to profile my code with intel Vtune. When looking at the function call stack it looks like most of the time is spent on a function called system_call_after_swapgs
. However there is no stack information. My question is:
what is system_call_after_swapgs
? And how do I know where it was called from?
Asked
Active
Viewed 4,185 times
4

Vladimir F Героям слава
- 57,977
- 4
- 76
- 119

Manfredo
- 1,760
- 4
- 25
- 53
-
It appears to be a Linux (kernel?) system function. If you in fact do not use Linux, you can remove the tag I added. – Vladimir F Героям слава Mar 21 '18 at 10:25
-
Do you have any guess about what it is doing? My feeling is that the program spends a lot of time waiting for threads to finish due to a high load imbalance. However I can't see which part of the code is running slow. – Manfredo Mar 22 '18 at 10:31
-
My guess was the same. I don't know any details. – Vladimir F Героям слава Mar 22 '18 at 11:37
1 Answers
3
I also see that sysret_check
is very high. I bet if you run general exploration, then extend frontend bound/frontend latency, you'll see high % of branch resteers. If so, this is likely a performance side effects of u-code patches against Spectre attacks, that clear BTB on system calls/returns to user mode.
If this system is air-gapped, or you have other good protection measures against attacks gaining local shell, you could revert BIOS to pre-2018 versions that do not include the u-code patch.

Vladimir F Героям слава
- 57,977
- 4
- 76
- 119

izard
- 56
- 1
- 5
-
This comment is the closest I can find to what `sysret_check` IS. Can you expand this answer at all, perhaps with references? – jwm Jun 04 '21 at 23:58