1
0
mirror of https://github.com/golang/go synced 2024-11-23 17:20:02 -07:00
go/src
Austin Clements eb3b1830b0 runtime: attach mark workers to P after they park
Currently mark workers attach to their designated Ps before parking,
either during initialization or after performing a phase transition.
However, in both of these cases, it's possible that the mark worker is
running on a different P than the one it attaches to. This is a
problem, because as soon as the worker attaches to a P, that P's
scheduler can execute the worker. If the worker hasn't yet parked on
the P it's actually running on, this means the worker G will be
running in two places at once. The most visible consequence of this is
that once the first instance of the worker does park, it will clear
g.m and the second instance will crash shortly when it tries to use
g.m.

Fix this by moving the attach to the gopark callback. At this point,
the G is genuinely stopped and the callback is running on the system
stack, so it's safe for another P's scheduler to pick up the worker G.

Fixes #13363. Fixes #13978.

Change-Id: If2f7c4a4174f9511f6227e14a27c56fb842d1cc8
Reviewed-on: https://go-review.googlesource.com/18761
Reviewed-by: Rick Hudson <rlh@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
2016-01-27 02:13:53 +00:00
..
archive archive/zip: clarify expectations of RegisterCompressor and RegisterDecompressor 2016-01-27 00:22:03 +00:00
bufio bufio: clarify Read docs 2015-12-01 20:05:25 +00:00
builtin
bytes bytes: document that buffer is reused in Truncate and Reset 2015-12-18 19:40:58 +00:00
cmd cmd/internal/obj/arm64: adjust literal pool flush for span-dependent jump enlargement 2016-01-27 00:58:39 +00:00
compress build: shorten a few packages with long tests 2015-12-29 15:46:44 +00:00
container
crypto crypto/rsa: expand on documentation and add some examples. 2016-01-27 00:11:22 +00:00
database/sql database/sql/driver: clarify DefaultParameterConverter docs 2016-01-13 18:15:38 +00:00
debug debug/dwarf: fix nil pointer dereference in cyclic type structures 2016-01-14 02:05:31 +00:00
encoding encoding/xml: update docs for Token 2016-01-24 16:07:30 +00:00
errors
expvar
flag
fmt Revert "fmt: check newline in the end of input" 2015-12-11 06:35:20 +00:00
go net/http: update http2 to check header values, move from vendor to internal 2016-01-21 00:19:02 +00:00
hash cmd/internal/obj/x86: add new instructions, cleanup. 2016-01-13 14:04:44 +00:00
html text/template,html/template: correct comment in DefinedTemplates 2015-11-24 21:52:36 +00:00
image image/color: have NYCbCrA.RGBA work in 16-bit color. 2015-12-24 06:55:33 +00:00
index/suffixarray
internal net/http: update http2 to check header values, move from vendor to internal 2016-01-21 00:19:02 +00:00
io io/ioutil: add examples to functions 2015-11-30 19:47:18 +00:00
log log/syslog: document that syslog is frozen 2016-01-05 22:56:07 +00:00
math math/big: fix Exp(x, x, x) for certain large x 2016-01-13 01:43:35 +00:00
mime mime: fix parsing of empty string attribute value 2015-12-05 20:14:25 +00:00
net net/http: quiet http2 log spam 2016-01-26 21:04:27 +00:00
os runtime: for c-archive/c-shared, install signal handlers synchronously 2016-01-09 00:58:38 +00:00
path path/filepath: include test number in TestIssue13582 output 2015-12-15 06:43:35 +00:00
reflect reflect: document DeepEqual, fix case of maps with NaN keys 2015-12-11 05:50:05 +00:00
regexp regexp/syntax: fix factoring of common prefixes in alternations 2016-01-08 16:41:46 +00:00
runtime runtime: attach mark workers to P after they park 2016-01-27 02:13:53 +00:00
sort sort: improve average quicksort performance 2015-12-04 20:41:47 +00:00
strconv
strings
sync internal/race: add package 2015-11-26 16:50:31 +00:00
syscall cmd/compile: recognize Syscall-like functions for liveness analysis 2016-01-14 01:16:45 +00:00
testing testing: move comment inside T.Parallel 2016-01-06 17:59:55 +00:00
text text/template: fix documentation for pipelines 2016-01-21 18:41:36 +00:00
time time: fix comment about use of Location.cacheEnd 2016-01-26 15:16:47 +00:00
unicode unicode/utf8: add test for FullRune 2015-12-01 10:39:06 +00:00
unsafe unsafe: document valid uses of Pointer 2016-01-22 21:08:44 +00:00
vendor net/http: update http2 to check header values, move from vendor to internal 2016-01-21 00:19:02 +00:00
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash build: use consistent shebang line 2016-01-14 03:16:20 +00:00
buildall.bash build: test linux/mips64 and linux/mips64le with buildall.bash 2016-01-19 04:43:44 +00:00
clean.bash
clean.bat
clean.rc
iostest.bash
make.bash src: remove reference to since-deleted dist -s flag 2015-12-17 22:03:56 +00:00
make.bat
Make.dist
make.rc
nacltest.bash
race.bash cmd/dist: make test default to --no-rebuild 2015-12-29 15:20:00 +00:00
race.bat cmd/dist: make test default to --no-rebuild 2015-12-29 15:20:00 +00:00
run.bash cmd/dist: make test default to --no-rebuild 2015-12-29 15:20:00 +00:00
run.bat cmd/dist: make test default to --no-rebuild 2015-12-29 15:20:00 +00:00
run.rc cmd/dist: make test default to --no-rebuild 2015-12-29 15:20:00 +00:00