3 ms·
When Intel benchmarks the performance of certain instructions, they compile the code into a kernel module, and run them with interrupts turned off[0]. Even then
by kccqzy 7y ago
When Intel benchmarks the performance of certain instructions, they compile the code into a kernel module, and run them with interrupts turned off[0]. Even then there are additional considerations like OoO execution, pipelining, etc. This could be applicable in some narrow scenarios but for most it's overkill. So the question is, how much of this consistency is really needed?
[0]: See sample code in https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/ia-32-ia-64-benchmark-code-execution-paper.pdf https://www.intel.com/content/dam/www/public/us/en/documents...
- amluto 7y agoI’m a bit afraid to mention this, but you can do iopl(3) and then use CLI and STI from user code. I try to keep this from breaking the kernel too badly.