]> Cypherpunks repositories - gostls13.git/commit
runtime: update gcController.scanWork regularly
authorAustin Clements <austin@google.com>
Mon, 5 Oct 2015 03:00:01 +0000 (23:00 -0400)
committerAustin Clements <austin@google.com>
Fri, 9 Oct 2015 19:38:29 +0000 (19:38 +0000)
commit8e8219deb5166ee67c8ba4409692de6fd7b67303
tree922549a3b746785977f6f62abaa7f77f9553a342
parentc18b163c1590d43d78a1a7386d624d4aab234f40
runtime: update gcController.scanWork regularly

Currently, gcController.scanWork is updated as lazily as possible
since it is only read at the end of the GC cycle. We're about to read
it during the GC cycle to improve the assist ratio revisions, so
modify gcDrain* to regularly flush to gcController.scanWork in much
the same way as we regularly flush to gcController.bgScanCredit.

One consequence of this is that it's difficult to keep gcw.scanWork
monotonic, so we give up on that and simply return the amount of scan
work done by gcDrainN rather than calculating it in the caller.

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