From: Austin Clements Date: Thu, 18 Feb 2016 14:38:49 +0000 (-0500) Subject: runtime: eliminate unused _Genqueue state X-Git-Tag: go1.7beta1~1708 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=cbe849fc38a63d55d74738276baab2fbc33e0c0d;p=gostls13.git runtime: eliminate unused _Genqueue state _Genqueue and _Gscanenqueue were introduced as part of the GC quiesce code. The quiesce code was removed by 197aa9e, but these states and some associated code stuck around. Remove them. Change-Id: I69df81881602d4a431556513dac2959668d27c20 Reviewed-on: https://go-review.googlesource.com/19638 Reviewed-by: Rick Hudson Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot --- diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 2dc53b5b72..d9c38f9cb0 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -660,10 +660,6 @@ func casfrom_Gscanstatus(gp *g, oldval, newval uint32) { if newval == oldval&^_Gscan { success = atomic.Cas(&gp.atomicstatus, oldval, newval) } - case _Gscanenqueue: - if newval == _Gwaiting { - success = atomic.Cas(&gp.atomicstatus, oldval, newval) - } } if !success { print("runtime: casfrom_Gscanstatus failed gp=", gp, ", oldval=", hex(oldval), ", newval=", hex(newval), "\n") @@ -680,15 +676,12 @@ func casfrom_Gscanstatus(gp *g, oldval, newval uint32) { func castogscanstatus(gp *g, oldval, newval uint32) bool { switch oldval { case _Grunnable, + _Grunning, _Gwaiting, _Gsyscall: if newval == oldval|_Gscan { return atomic.Cas(&gp.atomicstatus, oldval, newval) } - case _Grunning: - if newval == _Gscanrunning || newval == _Gscanenqueue { - return atomic.Cas(&gp.atomicstatus, oldval, newval) - } } print("runtime: castogscanstatus oldval=", hex(oldval), " newval=", hex(newval), "\n") throw("castogscanstatus") @@ -843,17 +836,6 @@ func restartg(gp *g) { _Gscanwaiting, _Gscansyscall: casfrom_Gscanstatus(gp, s, s&^_Gscan) - - // Scan is now completed. - // Goroutine now needs to be made runnable. - // We put it on the global run queue; ready blocks on the global scheduler lock. - case _Gscanenqueue: - casfrom_Gscanstatus(gp, _Gscanenqueue, _Gwaiting) - if gp != getg().m.curg { - throw("processing Gscanenqueue on wrong m") - } - dropg() - ready(gp, 0) } } diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index 6a4dfa17b8..5f22afd863 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -26,7 +26,7 @@ const ( _Gwaiting // 4 _Gmoribund_unused // 5 currently unused, but hardcoded in gdb scripts _Gdead // 6 - _Genqueue // 7 Only the Gscanenqueue is used. + _Genqueue_unused // 7 currently unused _Gcopystack // 8 in this state when newstack is moving the stack // the following encode that the GC is scanning the stack and what to do when it is done _Gscan = 0x1000 // atomicstatus&~Gscan = the non-scan state, @@ -37,7 +37,7 @@ const ( _Gscanwaiting = _Gscan + _Gwaiting // 0x1004 When scanning completes make it Gwaiting // _Gscanmoribund_unused, // not possible // _Gscandead, // not possible - _Gscanenqueue = _Gscan + _Genqueue // When scanning completes make it Grunnable and put on runqueue + // _Gscanenqueue_unused // not possible ) const ( diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go index b4bfe71627..1d76947380 100644 --- a/src/runtime/traceback.go +++ b/src/runtime/traceback.go @@ -645,7 +645,6 @@ var gStatusStrings = [...]string{ _Gsyscall: "syscall", _Gwaiting: "waiting", _Gdead: "dead", - _Genqueue: "enqueue", _Gcopystack: "copystack", }