Reputation: 651
How to test context switch performance? Firstly, we need to know all the scenarios of context switch.
I'm NOT sure that I'm able list all those scenarios:
Secondly, is there any way or method to test those context switch performance?
Any suggestions on context switch scenarios and test methods are warmly welcomed.
Upvotes: 3
Views: 3812
Reputation: 15218
You forgot system call induced context switch :-)
The lmbench benchmark suite has the lat_ctx test that tests context switch times. You can run it on your hardware to test the cost of context switches (http://www.bitmover.com/lmbench/)
In addition, recent Linux version has a performance testing tool called "perf" which can record and report how many context switches occurred during a run of a traced program as well as much more.
Hope this helps!
Upvotes: 4