Commit ceeda72b authored by Andrew Gerrand's avatar Andrew Gerrand

[release-branch.go1.1] runtime: prevent sysmon from polling network excessivly

««« CL 11569043 / 6b3c351c7fe6
runtime: prevent sysmon from polling network excessivly
If the network is not polled for 10ms, sysmon starts polling network
on every iteration (every 20us) until another thread blocks in netpoll.
Fixes  issue 5922 .

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/11569043
»»»

Update #5928

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/11438044
parent fc9a18f1
......@@ -2015,6 +2015,7 @@ sysmon(void)
lastpoll = runtime·atomicload64(&runtime·sched.lastpoll);
now = runtime·nanotime();
if(lastpoll != 0 && lastpoll + 10*1000*1000 > now) {
runtime·cas64(&runtime·sched.lastpoll, lastpoll, now);
gp = runtime·netpoll(false); // non-blocking
injectglist(gp);
}
......
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