]> Cypherpunks repositories - gostls13.git/commit
runtime: mark tiny blocks at GC start
authorAustin Clements <austin@google.com>
Fri, 9 Sep 2016 13:34:26 +0000 (09:34 -0400)
committerAustin Clements <austin@google.com>
Fri, 28 Oct 2016 20:05:28 +0000 (20:05 +0000)
commit85c22bc3a5e9ce03cd0ca668285755ce430456e0
tree2c1e9181839dfffdc8ef8d51414a2b13775b63d9
parentee785f03a24e0373be4c2d7256413296735c3414
runtime: mark tiny blocks at GC start

The hybrid barrier requires allocate-black, but there's one case where
we don't currently allocate black: the tiny allocator. If we allocate
a *new* tiny alloc block during GC, it will be allocated black, but if
we allocated the current block before GC, it won't be black, and the
further allocations from it won't mark it, which means we may free a
reachable tiny block during sweeping.

Fix this by passing over all mcaches at the beginning of mark, while
the world is still stopped, and greying their tiny blocks.

Updates #17503.

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