Repository navigation
internal/trace: preserve syscall ownership when a P is reused - #82674
Open
JakeNesler wants to merge 1 commit into
Open
JakeNesler wants to merge 1 commit into
JakeNesler wants to merge 1 commit into
Conversation
Only delete a syscall's processor association if it still belongs to the returning goroutine. A P can be stolen from G1 and reused by G2 for another syscall before G1 returns. Clearing G1's state currently removes G2's association too, causing the summarizer to count G2's blocked time as execution. Add a generated trace and a table test covering both goroutines. For G2, the fixture reports 256 ns executing and 192 ns blocked, instead of 448 ns executing and no blocked time. Tests passed on linux/arm64 at 63313a0 with the candidate source overlay and, for code-generation checks, the rebuilt compiler: go test -count=3 -overlay=/work/syscall-arm64.json internal/trace/... cmd/trace go test -race -short -overlay=/work/syscall-arm64.json internal/trace/... cmd/trace The package tests also passed on linux/amd64. Full all.bash was not run. CartoGopher tooling for source navigation; reproduction, implementation and testing with Codex. Fixes golang#82673
Contributor
|
This PR (HEAD: ae5009b) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/855641. Important tips:
|
Contributor
|
Message from Michael Knyszek: Patch Set 2: Code-Review+2 Please don’t reply on this GitHub thread. Visit golang.org/cl/855641. |
Contributor
|
Message from Neal Patel: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/855641. |
Contributor
|
Message from Jacob Nesler (Jake Nesler): Patch Set 3: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/855641. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Only clear a P's syscall association if it belongs to the returning
goroutine. The P may have been reused for another syscall, whose blocked
time would otherwise be counted as execution.
Fixes #82673