Commit cbe849fc authored by Austin Clements's avatar Austin Clements

runtime: eliminate unused _Genqueue state

_Genqueue and _Gscanenqueue were introduced as part of the GC quiesce
code. The quiesce code was removed by 197aa9e6, but these states and
some associated code stuck around. Remove them.

Change-Id: I69df81881602d4a431556513dac2959668d27c20
Reviewed-on: https://go-review.googlesource.com/19638Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 4eb33f6b
...@@ -660,10 +660,6 @@ func casfrom_Gscanstatus(gp *g, oldval, newval uint32) { ...@@ -660,10 +660,6 @@ func casfrom_Gscanstatus(gp *g, oldval, newval uint32) {
if newval == oldval&^_Gscan { if newval == oldval&^_Gscan {
success = atomic.Cas(&gp.atomicstatus, oldval, newval) success = atomic.Cas(&gp.atomicstatus, oldval, newval)
} }
case _Gscanenqueue:
if newval == _Gwaiting {
success = atomic.Cas(&gp.atomicstatus, oldval, newval)
}
} }
if !success { if !success {
print("runtime: casfrom_Gscanstatus failed gp=", gp, ", oldval=", hex(oldval), ", newval=", hex(newval), "\n") 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) { ...@@ -680,15 +676,12 @@ func casfrom_Gscanstatus(gp *g, oldval, newval uint32) {
func castogscanstatus(gp *g, oldval, newval uint32) bool { func castogscanstatus(gp *g, oldval, newval uint32) bool {
switch oldval { switch oldval {
case _Grunnable, case _Grunnable,
_Grunning,
_Gwaiting, _Gwaiting,
_Gsyscall: _Gsyscall:
if newval == oldval|_Gscan { if newval == oldval|_Gscan {
return atomic.Cas(&gp.atomicstatus, oldval, newval) 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") print("runtime: castogscanstatus oldval=", hex(oldval), " newval=", hex(newval), "\n")
throw("castogscanstatus") throw("castogscanstatus")
...@@ -843,17 +836,6 @@ func restartg(gp *g) { ...@@ -843,17 +836,6 @@ func restartg(gp *g) {
_Gscanwaiting, _Gscanwaiting,
_Gscansyscall: _Gscansyscall:
casfrom_Gscanstatus(gp, s, s&^_Gscan) 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)
} }
} }
......
...@@ -26,7 +26,7 @@ const ( ...@@ -26,7 +26,7 @@ const (
_Gwaiting // 4 _Gwaiting // 4
_Gmoribund_unused // 5 currently unused, but hardcoded in gdb scripts _Gmoribund_unused // 5 currently unused, but hardcoded in gdb scripts
_Gdead // 6 _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 _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 // 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, _Gscan = 0x1000 // atomicstatus&~Gscan = the non-scan state,
...@@ -37,7 +37,7 @@ const ( ...@@ -37,7 +37,7 @@ const (
_Gscanwaiting = _Gscan + _Gwaiting // 0x1004 When scanning completes make it Gwaiting _Gscanwaiting = _Gscan + _Gwaiting // 0x1004 When scanning completes make it Gwaiting
// _Gscanmoribund_unused, // not possible // _Gscanmoribund_unused, // not possible
// _Gscandead, // not possible // _Gscandead, // not possible
_Gscanenqueue = _Gscan + _Genqueue // When scanning completes make it Grunnable and put on runqueue // _Gscanenqueue_unused // not possible
) )
const ( const (
......
...@@ -645,7 +645,6 @@ var gStatusStrings = [...]string{ ...@@ -645,7 +645,6 @@ var gStatusStrings = [...]string{
_Gsyscall: "syscall", _Gsyscall: "syscall",
_Gwaiting: "waiting", _Gwaiting: "waiting",
_Gdead: "dead", _Gdead: "dead",
_Genqueue: "enqueue",
_Gcopystack: "copystack", _Gcopystack: "copystack",
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment