]> Cypherpunks repositories - gostls13.git/commit
runtime: beginning of decentralized off->mark transition
authorAustin Clements <austin@google.com>
Fri, 23 Oct 2015 18:15:18 +0000 (14:15 -0400)
committerAustin Clements <austin@google.com>
Thu, 5 Nov 2015 21:23:17 +0000 (21:23 +0000)
commitf54bcedce19a2c5aed897a8697e65ba037a8f53d
treee0b47864b377f620d9b3f9197ce5ffa2d350ec97
parent384259628460f9975471332a0618d5bffa40507d
runtime: beginning of decentralized off->mark transition

This begins the conversion of the centralized GC coordinator to a
decentralized state machine by introducing the internal API that
triggers the first state transition from _GCoff to _GCmark (or
_GCmarktermination).

This change introduces the transition lock, the off->mark transition
condition (which is very similar to shouldtriggergc()), and the
general structure of a state transition. Since we're doing this
conversion in stages, it then falls back to the GC coordinator to
actually execute the cycle. We'll start moving logic out of the GC
coordinator and in to transition functions next.

This fixes a minor bug in gcstoptheworld debug mode where passing the
heap trigger once could trigger multiple STW GCs.

Updates #11970.

Change-Id: I964087dd190a639eb5766398f8e1bbf8b352902f
Reviewed-on: https://go-review.googlesource.com/16355
Reviewed-by: Rick Hudson <rlh@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
src/runtime/malloc.go
src/runtime/mgc.go
src/runtime/mheap.go
src/runtime/proc.go
src/runtime/trace.go