Change-Id: Ia238889a704812473b838b20efedfe9d24b1e26f
Reviewed-on: https://go-review.googlesource.com/c/go/+/534160
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
// as part of tests and benchmarks to get the system into a
// relatively stable and isolated state.
for work.cycles.Load() == n+1 && sweepone() != ^uintptr(0) {
- sweep.nbgsweep++
Gosched()
}
// We check the transition condition continuously here in case
// this G gets delayed in to the next GC cycle.
for trigger.test() && sweepone() != ^uintptr(0) {
- sweep.nbgsweep++
}
// Perform GC initialization and the sweep termination
// Reset idle time stat.
sched.idleTime.Store(0)
- // Reset sweep state.
- sweep.nbgsweep = 0
- sweep.npausesweep = 0
-
if work.userForced {
memstats.numforcedgc++
}
}
// Sweep all spans eagerly.
for sweepone() != ^uintptr(0) {
- sweep.npausesweep++
}
// Free workbufs eagerly.
prepareFreeWorkbufs()
g *g
parked bool
- nbgsweep uint32
- npausesweep uint32
-
// active tracks outstanding sweepers and the sweep
// termination condition.
active activeSweep
// instantly. If GC was forced before the concurrent sweep
// finished, there may be spans to sweep.
for sweepone() != ^uintptr(0) {
- sweep.npausesweep++
}
// Make sure there aren't any outstanding sweepers left.
const sweepBatchSize = 10
nSwept := 0
for sweepone() != ^uintptr(0) {
- sweep.nbgsweep++
nSwept++
if nSwept%sweepBatchSize == 0 {
goschedIfBusy()