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

runtime: observed hot HITM with false-sharing, pointing to GC object #60337

Closed
gavinlichn opened this issue May 22, 2023 · 3 comments
Closed
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@gavinlichn
Copy link
Contributor

What version of Go are you using (go version)?

$ go version
1.20.4

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ansible/.cache/go-build"
GOENV="/home/ansible/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/ansible/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/ansible/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.4"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2935128198=/tmp/go-build -gno-record-gcc-switches"

What did you do?

run gRPC benchmark and DeathStarBench hotelReservation

https://github.com/grpc/grpc-go/tree/master/benchmark
https://github.com/delimitrou/DeathStarBench/tree/master/hotelReservation

What did you expect to see?

No significant false-sharing observed

What did you see instead?

Hottest cache line HITM pointing to a false-sharing, and the hottest one contribute ~4% or more HITM

perf-c2c report top HITM as below(shorten output):

`
image

`

@gavinlichn
Copy link
Contributor Author

Submitted patch for review: https://go-review.googlesource.com/c/go/+/496915

@gopherbot
Copy link

Change https://go.dev/cl/496915 mentions this issue: runtime/mgc: add a CacheLinePad to prevent false-sharing

@mknyszek mknyszek changed the title runtime/mgc Observed hot HITM with false-sharing, pointing to GC object runtime: observed hot HITM with false-sharing, pointing to GC object May 22, 2023
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label May 22, 2023
@mknyszek mknyszek added the NeedsFix The path to resolution is known, but the work has not been done. label May 22, 2023
@mknyszek mknyszek added this to the Go1.21 milestone May 22, 2023
@gavinlichn
Copy link
Contributor Author

Change have been merged:
https://go-review.googlesource.com/c/go/+/496915

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants