diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2015-02-17 14:25:49 +0300 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2015-02-20 16:52:13 +0000 |
| commit | 6e70fddec0e1d4a43ffb450f555dde82ff313397 (patch) | |
| tree | 98a56d25b0af2800f77748e67a919859faa15f12 /src/runtime/runtime1.go | |
| parent | 5868ce3519313dfa60dbc9192bf6b701b25bd4ca (diff) | |
| download | go-6e70fddec0e1d4a43ffb450f555dde82ff313397.tar.xz | |
runtime: fix cputicks on x86
See the following issue for context:
https://github.com/golang/go/issues/9729#issuecomment-74648287
In short, RDTSC can produce skewed results without preceding LFENCE/MFENCE.
Information on this matter is very scrappy in the internet.
But this is what linux kernel does (see rdtsc_barrier).
It also fixes the test program on my machine.
Update #9729
Change-Id: I3c1ffbf129fdfdd388bd5b7911b392b319248e68
Reviewed-on: https://go-review.googlesource.com/5033
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/runtime1.go')
| -rw-r--r-- | src/runtime/runtime1.go | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/src/runtime/runtime1.go b/src/runtime/runtime1.go index c056bfcdbf..f0d26c8edc 100644 --- a/src/runtime/runtime1.go +++ b/src/runtime/runtime1.go @@ -58,13 +58,6 @@ var ( iswindows int32 ) -// Information about what cpu features are available. -// Set on startup in asm_{x86/amd64}.s. -var ( -//cpuid_ecx uint32 -//cpuid_edx uint32 -) - func goargs() { if GOOS == "windows" { return |
