]> Cypherpunks repositories - gostls13.git/commit
runtime: fix gcpacertrace printing of sweep ratio
authorAustin Clements <austin@google.com>
Mon, 3 Apr 2017 19:14:56 +0000 (15:14 -0400)
committerAustin Clements <austin@google.com>
Wed, 5 Apr 2017 18:24:52 +0000 (18:24 +0000)
commitecb7b63820b8c28d8b2ea4ac1df194d19837e48e
tree9d096ced3c4efe630aa38d64a313939be0d03940
parent92cffa13917023ca8a894160c71b73670f4e74f2
runtime: fix gcpacertrace printing of sweep ratio

Commit 44ed88a5a7 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: Rick Hudson <rlh@golang.org>
src/runtime/mgcsweep.go