1
0
mirror of https://github.com/golang/go synced 2024-10-04 13:21:22 -06:00
go/src
Austin Clements 9a31d38f65 runtime: remove sweep wait loop in finishsweep_m
In general, finishsweep_m must block until any spans that are
concurrently being swept have been swept. It accomplishes this by
looping over all spans, which, as in the previous commit, takes
~1ms/heap GB. Unfortunately, we do this during the STW sweep
termination phase, so multi-gigabyte heaps can push our STW time past
10ms.

However, there's no need to do this wait if the world is stopped
because, in effect, stopping the world already had to wait for
anything that was sweeping (and if it didn't, the wait in
finishsweep_m would deadlock). Hence, we can simply skip this loop if
the world is stopped, such as during sweep termination. In fact,
currently all calls to finishsweep_m are STW, but this hasn't always
been the case and may not be the case in the future, so we keep the
logic around.

For 24GB heaps, this reduces max pause time by 75% relative to tip and
by 90% relative to Go 1.5. Notably, all pauses are now well under
10ms. Here are the results for the garbage benchmark:

               ------------- max pause ------------
Heap   Procs   after change   before change   1.5.1
24GB     12        3.8ms          16ms         37ms
24GB      4        3.7ms          16ms         37ms
 4GB      4        3.7ms           3ms        6.9ms

In the 4GB/4P case, it seems the "before change" run got lucky: the
max went up, but the 99%ile pause time went down from 3ms to 2.04ms.

Change-Id: Ica22189559f231d408ef2815019c9dbb5f38bf31
Reviewed-on: https://go-review.googlesource.com/15071
Reviewed-by: Rick Hudson <rlh@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-10-02 19:56:01 +00:00
..
archive archive/tar: make Reader.Read errors persistent 2015-10-01 22:33:33 +00:00
bufio bufio: fix scanning with a final empty token. 2015-09-25 21:46:13 +00:00
builtin
bytes bytes: improve Compare function on amd64 for large byte arrays 2015-08-26 03:52:20 +00:00
cmd runtime: darwin/386 entrypoint for c-archive 2015-10-02 11:45:52 +00:00
compress compress/zlib: detect truncated streams 2015-09-30 22:47:28 +00:00
container
crypto crypto/x509: parse CSRs with a critical flag in the requested extensions. 2015-09-30 00:59:15 +00:00
database/sql database/sql: fix case where Stmt.Close discards error 2015-10-02 14:38:02 +00:00
debug debug/dwarf: add test for split DWARF 2015-09-15 17:57:56 +00:00
encoding encoding/binary: document that Read returns io.EOF iff zero bytes are read 2015-09-30 22:10:44 +00:00
errors
expvar
flag flag: add comment stating that Set is called in sequence across the command line 2015-07-16 05:33:47 +00:00
fmt fmt: allow any type in a format's width argument 2015-09-10 20:53:22 +00:00
go go/types: fix incorrect comment at Info.Implicits. 2015-10-01 19:56:58 +00:00
hash hash/crc32: add AMD64 optimized IEEE CRC calculation 2015-09-16 15:42:42 +00:00
html text/template: change IsTrue to take interface{} instead of reflect.Value. 2015-10-01 04:36:35 +00:00
image image/png: integer underflow when decoding 2015-09-21 23:09:22 +00:00
index/suffixarray
internal go/format, cmd/gofmt: avoid dependency on internal package format 2015-09-30 16:32:47 +00:00
io io: add WriteString support to MultiWriter 2015-09-01 04:00:12 +00:00
log
math math/big: correct documentation for ProbablyPrime. 2015-09-30 00:39:00 +00:00
mime multipart: fixes problem parsing mime/multipart of certain lengths 2015-09-24 09:00:52 +00:00
net net: make /etc/hosts lookups case-insensitive 2015-10-01 20:52:54 +00:00
os os: document that behavior of Seek on O_APPEND files is not specified 2015-09-23 17:06:02 +00:00
path all: fix some vet-caught formatting errors, mostly but not only in tests 2015-08-21 05:37:36 +00:00
reflect runtime: on map update, don't overwrite key if we don't need to. 2015-09-09 21:06:49 +00:00
regexp regexp: add runnable example to regex.Split 2015-09-23 03:29:32 +00:00
runtime runtime: remove sweep wait loop in finishsweep_m 2015-10-02 19:56:01 +00:00
sort sort: Fix typo in Stable() comment 2015-08-17 06:58:16 +00:00
strconv strconv: slightly simplified roundShortest; better comments 2015-09-23 21:14:29 +00:00
strings
sync runtime, sync/atomic: add memory barriers in arm cas routines 2015-07-30 20:11:11 +00:00
syscall syscall: skip a couple tests when running under Kubernetes 2015-10-02 19:31:09 +00:00
testing testing/quick: terminate for arbitrary recursive types 2015-08-29 19:23:37 +00:00
text text/template: change IsTrue to take interface{} instead of reflect.Value. 2015-10-01 04:36:35 +00:00
time time: allow any one- or two-digit day of the month when parsing. 2015-09-10 20:27:53 +00:00
unicode unicode: include rune 0 in RangeTables. 2015-08-24 15:05:48 +00:00
unsafe
all.bash
all.bat
all.rc
androidtest.bash androidtest.bash: robust cleanup in case of failure. 2015-07-17 21:12:12 +00:00
bootstrap.bash build: Fix bootstrap.bash for official source tarballs 2015-09-01 19:52:59 +00:00
buildall.bash
clean.bash build: clean current tree in clean.bash 2015-08-05 19:36:15 +00:00
clean.bat
clean.rc
iostest.bash
make.bash make.bash: abort if $GOROOT_BOOTSTRAP == $GOROOT 2015-08-24 03:04:52 +00:00
make.bat
Make.dist
make.rc
nacltest.bash
race.bash
race.bat
run.bash
run.bat
run.rc