diff options
author | Keith Randall <khr@golang.org> | 2014-09-16 17:26:16 -0700 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2014-09-16 17:26:16 -0700 |
commit | bf1cf8a2e4e179e45a74f0daf3267e86cd92d659 (patch) | |
tree | c503b1b3cb2256ac04331799a10f18bcfd4d6118 /src/runtime/thunk.s | |
parent | 9eb03ec6a2705273aef1747cc008a0f4a8d9da32 (diff) | |
download | go-bf1cf8a2e4e179e45a74f0daf3267e86cd92d659.tar.gz |
runtime: always run semacquire on the G stack
semacquire might need to park the currently running G. It can
only park if called from the G stack (because it has no way of
saving the M stack state). So all calls to semacquire must come
from the G stack.
The three violators are GOMAXPROCS, ReadMemStats, and WriteHeapDump.
This change moves the semacquire call earlier, out of their C code
and into their Go code.
This seldom caused bugs because semacquire seldom actually had
to park the caller. But it did happen intermittently.
Fixes issue 8749
LGTM=dvyukov
R=golang-codereviews, dvyukov, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/144940043
Diffstat (limited to 'src/runtime/thunk.s')
-rw-r--r-- | src/runtime/thunk.s | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/thunk.s b/src/runtime/thunk.s index 3b66cf47d..3dd86e991 100644 --- a/src/runtime/thunk.s +++ b/src/runtime/thunk.s @@ -80,6 +80,9 @@ TEXT reflect·memmove(SB), NOSPLIT, $0-0 TEXT runtime∕debug·freeOSMemory(SB), NOSPLIT, $0-0 JMP runtime·freeOSMemory(SB) +TEXT runtime∕debug·WriteHeapDump(SB), NOSPLIT, $0-0 + JMP runtime·writeHeapDump(SB) + TEXT net·runtime_pollServerInit(SB),NOSPLIT,$0-0 JMP runtime·netpollServerInit(SB) |