• Austin Clements's avatar
    runtime: update gcController.scanWork regularly · 8e8219de
    Austin Clements authored
    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/15407Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
    8e8219de
mgcwork.go 12.6 KB