Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why there is the need for the mfence before and after rdtsc? #14

Open
zyma-Jasper opened this issue Feb 15, 2021 · 0 comments
Open

Why there is the need for the mfence before and after rdtsc? #14

zyma-Jasper opened this issue Feb 15, 2021 · 0 comments

Comments

@zyma-Jasper
Copy link

Intel suggests to use a cpuid rdtsc instruction rdtsc cpuid sequence to measure the time.link. Also the test sequence is fence cpuid rdtsc instruction rdtsc cpuid mfence in the software prefetch paper of CCS16. So why here the calibration code use the mfence rdtsc mfence instr mfence rdtsc mfence sequece? I have combine the test process to one specific cpu0 and give it highest priority, Also I have isolated one specific cpu to make sure no other processes can run on it. However, I still get different thresholds after each run. Sometimes 220 cycles and sometimes 130 cycles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant