diff options
Diffstat (limited to 'src/runtime/mgc.go')
-rw-r--r-- | src/runtime/mgc.go | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go index 63e04636d7..84a7216b10 100644 --- a/src/runtime/mgc.go +++ b/src/runtime/mgc.go @@ -811,21 +811,21 @@ top: // result in a deadlock as we attempt to preempt a worker that's // trying to preempt us (e.g. for a stack scan). casgstatus(gp, _Grunning, _Gwaiting) - forEachP(func(_p_ *p) { + forEachP(func(pp *p) { // Flush the write barrier buffer, since this may add // work to the gcWork. - wbBufFlush1(_p_) + wbBufFlush1(pp) // Flush the gcWork, since this may create global work // and set the flushedWork flag. // // TODO(austin): Break up these workbufs to // better distribute work. - _p_.gcw.dispose() + pp.gcw.dispose() // Collect the flushedWork flag. - if _p_.gcw.flushedWork { + if pp.gcw.flushedWork { atomic.Xadd(&gcMarkDoneFlushed, 1) - _p_.gcw.flushedWork = false + pp.gcw.flushedWork = false } }) casgstatus(gp, _Gwaiting, _Grunning) @@ -929,11 +929,10 @@ func gcMarkTermination() { mp := acquirem() mp.preemptoff = "gcing" - _g_ := getg() - _g_.m.traceback = 2 - gp := _g_.m.curg - casgstatus(gp, _Grunning, _Gwaiting) - gp.waitreason = waitReasonGarbageCollection + mp.traceback = 2 + curgp := mp.curg + casgstatus(curgp, _Grunning, _Gwaiting) + curgp.waitreason = waitReasonGarbageCollection // Run gc on the g0 stack. We do this so that the g stack // we're currently running on will no longer change. Cuts @@ -972,8 +971,8 @@ func gcMarkTermination() { gcSweep(work.mode) }) - _g_.m.traceback = 0 - casgstatus(gp, _Gwaiting, _Grunning) + mp.traceback = 0 + casgstatus(curgp, _Gwaiting, _Grunning) if trace.enabled { traceGCDone() @@ -1075,8 +1074,8 @@ func gcMarkTermination() { // is necessary to sweep all spans, we need to ensure all // mcaches are flushed before we start the next GC cycle. systemstack(func() { - forEachP(func(_p_ *p) { - _p_.mcache.prepareForSweep() + forEachP(func(pp *p) { + pp.mcache.prepareForSweep() }) }) // Now that we've swept stale spans in mcaches, they don't |