]> Cypherpunks repositories - gostls13.git/commit
runtime: count black allocations toward scan work
authorAustin Clements <austin@google.com>
Sat, 16 Apr 2016 22:27:38 +0000 (18:27 -0400)
committerAustin Clements <austin@google.com>
Thu, 21 Apr 2016 20:07:17 +0000 (20:07 +0000)
commit479501c14c9d36e27727bc4b4294d57c5ddc29d0
tree9eb30469d54d57e05aff9e906e08695ff227d43b
parenta683c385ad874b0066787dc010cacba8aaff894c
runtime: count black allocations toward scan work

Currently we count black allocations toward the scannable heap size,
but not toward the scan work we've done so far. This is clearly
inconsistent (we have, in effect, scanned these allocations and since
they're already black, we're not going to scan them again). Worse, it
means we don't count black allocations toward the scannable heap size
as of the *next* GC because this is based on the amount of scan work
we did in this cycle.

Fix this by counting black allocations as scan work. Currently the GC
spends very little time in allocate-black mode, so this probably
hasn't been a problem, but this will become important when we switch
to always allocating black.

Change-Id: If6ff693b070c385b65b6ecbbbbf76283a0f9d990
Reviewed-on: https://go-review.googlesource.com/22119
Reviewed-by: Rick Hudson <rlh@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/runtime/malloc.go
src/runtime/mgc.go
src/runtime/mgcmark.go