Fix DTrace TSC skew calculation:

The skew calculation here is exactly backwards. We were able to repro
it on a multi-package ESX server running a FreeBSD VM, where the TSCs
can be pretty evil.

MFC after: 1 week

Submitted by: Jeff Ford <jeffrey.ford2@isilon.com>
Reviewed by: avg, gnn
This commit is contained in:
Zachary Loafman 2012-06-04 16:04:01 +00:00
parent 932c975298
commit db5c7d363d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=236566
2 changed files with 2 additions and 2 deletions

View File

@ -446,7 +446,7 @@ dtrace_gethrtime()
* (see nsec_scale calculations) taking into account 32-bit shift of
* the higher half and finally add.
*/
tsc = rdtsc() + tsc_skew[curcpu];
tsc = rdtsc() - tsc_skew[curcpu];
lo = tsc;
hi = tsc >> 32;
return (((lo * nsec_scale) >> SCALE_SHIFT) +

View File

@ -447,7 +447,7 @@ dtrace_gethrtime()
* (see nsec_scale calculations) taking into account 32-bit shift of
* the higher half and finally add.
*/
tsc = rdtsc() + tsc_skew[curcpu];
tsc = rdtsc() - tsc_skew[curcpu];
lo = tsc;
hi = tsc >> 32;
return (((lo * nsec_scale) >> SCALE_SHIFT) +