• Austin Clements's avatar
    runtime: fix gcpacertrace printing of sweep ratio · ecb7b638
    Austin Clements authored
    Commit 44ed88a5 moved printing of the "sweep done" gcpacertrace
    message so that it is printed when the final sweeper finishes.
    However, by this point some other thread has often already observed
    that there are no more spans to sweep and zeroed sweepPagesPerByte.
    
    Avoid printing a 0 sweep ratio in the trace when this race happens by
    getting the value of the sweep ratio upon entry to sweepone and
    printing that.
    
    Change-Id: Iac0c48ae899e12f193267cdfb012c921f8b71c85
    Reviewed-on: https://go-review.googlesource.com/39492
    
    
    Run-TryBot: Austin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: default avatarRick Hudson <rlh@golang.org>
    ecb7b638
mgcsweep.go 13.3 KB