The invariant is that there must be at least one running P or a thread polling network.
It was broken.
Fixes #5216.
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/
8459043
startm(p, false);
return;
}
+ // If this is the last running P and nobody is polling network,
+ // need to wakeup another M to poll network.
+ if(runtime·sched.npidle == runtime·gomaxprocs-1 && runtime·atomicload64(&runtime·sched.lastpoll) != 0) {
+ runtime·unlock(&runtime·sched);
+ startm(p, false);
+ return;
+ }
pidleput(p);
runtime·unlock(&runtime·sched);
}