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

server: reimplement growStack hack in assembly #37967

Merged
merged 1 commit into from
Jun 3, 2019

Conversation

petermattis
Copy link
Collaborator

The go1.12 compiler breaks the Go version of the growStack hack (it
optimizes the 16kb stack variable out of existence). Reimplement
growStack in assembly which will be same from the machinations of the Go
compiler.

Release note (performance improvement): Fix a significant performance
regression when building CockroachDB with go1.12.

The go1.12 compiler breaks the Go version of the growStack hack (it
optimizes the 16kb stack variable out of existence). Reimplement
growStack in assembly which will be same from the machinations of the Go
compiler.

Release note (performance improvement): Fix a significant performance
regression when building CockroachDB with go1.12.
@petermattis petermattis requested a review from a team June 1, 2019 20:11
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@petermattis
Copy link
Collaborator Author

See #37966

Copy link
Member

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nice find. Any idea what change in the Go compiler caused the old hack to be optimized away?

The symptoms you saw in #37966 (comment) look awfully similar to what @jeffrey-xiao and I are seeing in #37706. It's possible that we're seeing a very similar issue where the difference in proto padding is causing stack growth underneath the HLC clock mutex (instead of somewhere else) and destroying performance. Once this is merged, we should dig into whether we can have any effect on the perf drop by playing around with this new Grow function. Go 1.12 should also help us determine whether we can attribute slowdown of the clock to stack growth.

@petermattis
Copy link
Collaborator Author

bors r=nvanbenschoten

craig bot pushed a commit that referenced this pull request Jun 3, 2019
37967: server: reimplement growStack hack in assembly r=nvanbenschoten a=petermattis

The go1.12 compiler breaks the Go version of the growStack hack (it
optimizes the 16kb stack variable out of existence). Reimplement
growStack in assembly which will be same from the machinations of the Go
compiler.

Release note (performance improvement): Fix a significant performance
regression when building CockroachDB with go1.12.

Co-authored-by: Peter Mattis <[email protected]>
@craig
Copy link
Contributor

craig bot commented Jun 3, 2019

Build succeeded

@craig craig bot merged commit a2d0d6b into cockroachdb:master Jun 3, 2019
@bdarnell
Copy link
Contributor

bdarnell commented Jun 3, 2019

No GNU_STACK magic? Did my test not run or does this somehow avoid setting the exec-stack flag?

@petermattis
Copy link
Collaborator Author

petermattis commented Jun 3, 2019 via email

@bdarnell
Copy link
Contributor

bdarnell commented Jun 3, 2019

I don't think being empty matters. Or at least it's not sufficient; the empty file in the sql/exec package doesn't trigger it. There's something we don't understand going on here (my best guess is that it has something to do with whether or not cgo is in use in the package).

@petermattis petermattis deleted the pmattis/growstack branch June 4, 2019 00:23
@petermattis
Copy link
Collaborator Author

@bdarnell I ran scanelf -qe on a cockroach binary built with this PR and it didn't complain.

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

Successfully merging this pull request may close these issues.

4 participants