mirror of
https://github.com/golang/go
synced 2024-11-18 09:04:49 -07:00
runtime: don't run runq tests on the system stack
Running these tests on the system stack is problematic because they allocate Ps, which are large enough to overflow the system stack if they are stack-allocated. It used to be necessary to run these tests on the system stack because they were written in C, but since this is no longer the case, we can fix this problem by simply not running the tests on the system stack. This also means we no longer need the hack in one of these tests that forces the allocated Ps to escape to the heap, so eliminate that as well. Change-Id: I9064f5f8fd7f7b446ff39a22a70b172cfcb2dc57 Reviewed-on: https://go-review.googlesource.com/9923 Reviewed-by: Rick Hudson <rlh@golang.org> Run-TryBot: Austin Clements <austin@google.com>
This commit is contained in:
parent
5ed4bb6db1
commit
350fd548b3
@ -83,10 +83,10 @@ func GCMask(x interface{}) (ret []byte) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func RunSchedLocalQueueTest() {
|
func RunSchedLocalQueueTest() {
|
||||||
systemstack(testSchedLocalQueue)
|
testSchedLocalQueue()
|
||||||
}
|
}
|
||||||
func RunSchedLocalQueueStealTest() {
|
func RunSchedLocalQueueStealTest() {
|
||||||
systemstack(testSchedLocalQueueSteal)
|
testSchedLocalQueueSteal()
|
||||||
}
|
}
|
||||||
|
|
||||||
var StringHash = stringHash
|
var StringHash = stringHash
|
||||||
|
@ -3539,13 +3539,9 @@ func testSchedLocalQueue() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var pSink *p
|
|
||||||
|
|
||||||
func testSchedLocalQueueSteal() {
|
func testSchedLocalQueueSteal() {
|
||||||
p1 := new(p)
|
p1 := new(p)
|
||||||
p2 := new(p)
|
p2 := new(p)
|
||||||
pSink = p1 // Force to heap, too large to allocate on system stack ("G0 stack")
|
|
||||||
pSink = p2 // Force to heap, too large to allocate on system stack ("G0 stack")
|
|
||||||
gs := make([]g, len(p1.runq))
|
gs := make([]g, len(p1.runq))
|
||||||
for i := 0; i < len(p1.runq); i++ {
|
for i := 0; i < len(p1.runq); i++ {
|
||||||
for j := 0; j < i; j++ {
|
for j := 0; j < i; j++ {
|
||||||
|
Loading…
Reference in New Issue
Block a user