6

I'm interessted in getting the number of context switches a two processes in a KVM vm takes on a singel CPU over some time.

Earlier i have used perf, is this best practice?

And how much time is used on a context switch per CPU?

emilrn
  • 103
  • 2
  • 9
  • There are many publications about this topic. For example, Quantifying the cost of context switch. https://dl.acm.org/doi/abs/10.1145/1281700.1281702 – hakunami Apr 30 '20 at 10:16

1 Answers1

9

About 1.2 microseconds which is about a thousand Cycles

https://eli.thegreenplace.net/2018/measuring-context-switching-and-memory-overheads-for-linux-threads/

user1133275
  • 5,488
  • 1
  • 19
  • 37