]> Cypherpunks repositories - gostls13.git/commit
runtime: parallelize STW mcache flushing
authorAustin Clements <austin@google.com>
Tue, 25 Oct 2016 17:56:37 +0000 (13:56 -0400)
committerAustin Clements <austin@google.com>
Fri, 28 Oct 2016 18:19:53 +0000 (18:19 +0000)
commita475a38a3dcd48541f60e40b1dac3c84ab72d0e5
treeac525d4f7fcb24e7f1216ee0b5b3a4dbc7ae9fcd
parent20edeabc0fc73c6212769142f80e921c2e07ee08
runtime: parallelize STW mcache flushing

Currently all mcaches are flushed in a single STW root job. This takes
about 5 µs per P, but since it's done sequentially it adds about
5*GOMAXPROCS µs to the STW.

Fix this by parallelizing the job. Since there are exactly GOMAXPROCS
mcaches to flush, this parallelizes quite nicely and brings the STW
latency cost down to a constant 5 µs (assuming GOMAXPROCS actually
reflects the number of CPUs).

Updates #17503.

Change-Id: Ibefeb1c2229975d5137c6e67fac3b6c92103742d
Reviewed-on: https://go-review.googlesource.com/32033
Reviewed-by: Rick Hudson <rlh@golang.org>
src/runtime/mgc.go
src/runtime/mgcmark.go
src/runtime/mstats.go