]> Cypherpunks repositories - gostls13.git/commit
runtime: don't recheck heap trigger for periodic GC
authorAustin Clements <austin@google.com>
Wed, 5 Aug 2015 15:07:47 +0000 (11:07 -0400)
committerAustin Clements <austin@google.com>
Wed, 5 Aug 2015 17:28:56 +0000 (17:28 +0000)
commitd57f03730265c4677ab2ec1ad74cf8cbf592f798
tree2344cefe0737b2f39e2b03d2786f47536827f94e
parent3dd3ab41acd5eeef5cfd9e83d75f325178ef6a9c
runtime: don't recheck heap trigger for periodic GC

88e945f introduced a non-speculative double check of the heap trigger
before actually starting a concurrent GC. This was necessary to fix a
race for heap-triggered GC, but broke sysmon-triggered periodic GC,
since the heap check will of course fail for periodically triggered
GC.

Fix this by telling startGC whether or not this GC was triggered by
heap size or a timer and only doing the heap size double check for GCs
triggered by heap size.

Fixes #12026.

Change-Id: I7c3f6ec364545c36d619f2b4b3bf3b758e3bcbd6
Reviewed-on: https://go-review.googlesource.com/13168
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/malloc.go
src/runtime/mgc.go
src/runtime/mheap.go
src/runtime/proc.go