diff options
| author | Austin Clements <austin@google.com> | 2016-01-26 14:44:58 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2016-01-27 02:23:09 +0000 |
| commit | 09940b92a08203aa3d2baa90fc29b80ccfcb32c5 (patch) | |
| tree | 6ee83042dfac2a61e807b2ce8069d871f33d4dc0 /src/runtime/proc.go | |
| parent | 08594ac7c7e123d4aa46f60690da0a7e4034f4e9 (diff) | |
| download | go-09940b92a08203aa3d2baa90fc29b80ccfcb32c5.tar.xz | |
runtime: make p.gcBgMarkWorker a guintptr
Currently p.gcBgMarkWorker is a *g. Change it to a guintptr. This
eliminates a write barrier during the subtle mark worker parking dance
(which isn't known to be causing problems, but may).
Change-Id: Ibf12c05ac910820448059e69a68e5b882c993ed8
Reviewed-on: https://go-review.googlesource.com/18970
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Rick Hudson <rlh@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/runtime/proc.go')
| -rw-r--r-- | src/runtime/proc.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 680c5faedd..2bc3c920dc 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -1867,9 +1867,9 @@ stop: // We have nothing to do. If we're in the GC mark phase, can // safely scan and blacken objects, and have work to do, run // idle-time marking rather than give up the P. - if _p_ := _g_.m.p.ptr(); gcBlackenEnabled != 0 && _p_.gcBgMarkWorker != nil && gcMarkWorkAvailable(_p_) { + if _p_ := _g_.m.p.ptr(); gcBlackenEnabled != 0 && _p_.gcBgMarkWorker != 0 && gcMarkWorkAvailable(_p_) { _p_.gcMarkWorkerMode = gcMarkWorkerIdleMode - gp := _p_.gcBgMarkWorker + gp := _p_.gcBgMarkWorker.ptr() casgstatus(gp, _Gwaiting, _Grunnable) if trace.enabled { traceGoUnpark(gp, 0) @@ -3206,15 +3206,15 @@ func procresize(nprocs int32) *p { } // if there's a background worker, make it runnable and put // it on the global queue so it can clean itself up - if p.gcBgMarkWorker != nil { - casgstatus(p.gcBgMarkWorker, _Gwaiting, _Grunnable) + if gp := p.gcBgMarkWorker.ptr(); gp != nil { + casgstatus(gp, _Gwaiting, _Grunnable) if trace.enabled { - traceGoUnpark(p.gcBgMarkWorker, 0) + traceGoUnpark(gp, 0) } - globrunqput(p.gcBgMarkWorker) + globrunqput(gp) // This assignment doesn't race because the // world is stopped. - p.gcBgMarkWorker = nil + p.gcBgMarkWorker.set(nil) } for i := range p.sudogbuf { p.sudogbuf[i] = nil |
