]> Cypherpunks repositories - gostls13.git/commitdiff
Revert "runtime: release worldsema before Gosched in STW GC mode"
authorMichael Knyszek <mknyszek@google.com>
Fri, 24 Jan 2020 16:50:53 +0000 (16:50 +0000)
committerMichael Knyszek <mknyszek@google.com>
Fri, 24 Jan 2020 23:27:22 +0000 (23:27 +0000)
This reverts commit 05511a5c0ae238325c10b0e4e44c3f66f928e4cf, CL 208379.

Reason for revert: So that we can cleanly revert
https://golang.org/cl/182657.

Change-Id: I4fdf4f864a093db7866b3306f0f8f856b9f4d684
Reviewed-on: https://go-review.googlesource.com/c/go/+/216357
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/runtime/mgc.go

index bda8eadc9d17af993704094b1a2cb98f10341093..0bc55684420d213a3e5c233245f2ac292977a5aa 100644 (file)
@@ -1368,13 +1368,6 @@ func gcStart(trigger gcTrigger) {
                work.pauseNS += now - work.pauseStart
                work.tMark = now
        })
-
-       // Release the world sema before Gosched() in STW mode
-       // because we will need to reacquire it later but before
-       // this goroutine becomes runnable again, and we could
-       // self-deadlock otherwise.
-       semrelease(&worldsema)
-
        // In STW mode, we could block the instant systemstack
        // returns, so don't do anything important here. Make sure we
        // block rather than returning to user code.
@@ -1382,6 +1375,7 @@ func gcStart(trigger gcTrigger) {
                Gosched()
        }
 
+       semrelease(&worldsema)
        semrelease(&work.startSema)
 }