]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: eliminate unused _Genqueue state
authorAustin Clements <austin@google.com>
Thu, 18 Feb 2016 14:38:49 +0000 (09:38 -0500)
committerAustin Clements <austin@google.com>
Thu, 25 Feb 2016 23:37:32 +0000 (23:37 +0000)
_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 <rlh@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/runtime/proc.go
src/runtime/runtime2.go
src/runtime/traceback.go

index 2dc53b5b72cc210171ff85f415ca3bd5cfac3b80..d9c38f9cb05cd8b00caf763ad81878ba5091f74e 100644 (file)
@@ -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)
        }
 }
 
index 6a4dfa17b8ac0fcb5f861caa481de647f554b5f7..5f22afd863dc01779b29fb9dea1a5ab14073703f 100644 (file)
@@ -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 (
index b4bfe716272929c8620704b19b890797a2005c31..1d76947380e5fe84b40201f2c3875ffe5715b349 100644 (file)
@@ -645,7 +645,6 @@ var gStatusStrings = [...]string{
        _Gsyscall:   "syscall",
        _Gwaiting:   "waiting",
        _Gdead:      "dead",
-       _Genqueue:   "enqueue",
        _Gcopystack: "copystack",
 }