diff options
author | Michael Knyszek <mknyszek@google.com> | 2020-01-24 16:51:11 +0000 |
---|---|---|
committer | Michael Knyszek <mknyszek@google.com> | 2020-01-24 23:27:33 +0000 |
commit | 64c22b70bf00e15615bb17c29f808b55bc339682 (patch) | |
tree | 568f5948390be827a761e65928f048597ab5b7ad /src/runtime/mgc.go | |
parent | ad3cef184e55ab53306a466bda100dc72c40fc3b (diff) | |
download | go-git-64c22b70bf00e15615bb17c29f808b55bc339682.tar.gz |
Revert "runtime: don't hold worldsema across mark phase"
This reverts commit 7b294cdd8df0a9523010f6ffc80c59e64578f34b, CL 182657.
Reason for revert: This change may be causing latency problems
for applications which call ReadMemStats, because it may cause
all goroutines to stop until the GC completes.
https://golang.org/cl/215157 fixes this problem, but it's too
late in the cycle to land that.
Updates #19812.
Change-Id: Iaa26f4dec9b06b9db2a771a44e45f58d0aa8f26d
Reviewed-on: https://go-review.googlesource.com/c/go/+/216358
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/mgc.go')
-rw-r--r-- | src/runtime/mgc.go | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go index 0bc5568442..604d7d09b4 100644 --- a/src/runtime/mgc.go +++ b/src/runtime/mgc.go @@ -1269,7 +1269,6 @@ func gcStart(trigger gcTrigger) { } // Ok, we're doing it! Stop everybody else - semacquire(&gcsema) semacquire(&worldsema) if trace.enabled { @@ -1375,7 +1374,6 @@ func gcStart(trigger gcTrigger) { Gosched() } - semrelease(&worldsema) semrelease(&work.startSema) } @@ -1438,10 +1436,6 @@ top: return } - // forEachP needs worldsema to execute, and we'll need it to - // stop the world later, so acquire worldsema now. - semacquire(&worldsema) - // Flush all local buffers and collect flushedWork flags. gcMarkDoneFlushed = 0 systemstack(func() { @@ -1502,7 +1496,6 @@ top: // work to do. Keep going. It's possible the // transition condition became true again during the // ragged barrier, so re-check it. - semrelease(&worldsema) goto top } @@ -1579,7 +1572,6 @@ top: now := startTheWorldWithSema(true) work.pauseNS += now - work.pauseStart }) - semrelease(&worldsema) goto top } } @@ -1797,7 +1789,6 @@ func gcMarkTermination(nextTriggerRatio float64) { } semrelease(&worldsema) - semrelease(&gcsema) // Careful: another GC cycle may start now. releasem(mp) |