diff options
author | Andrew Gerrand <adg@golang.org> | 2013-07-23 09:50:35 +1000 |
---|---|---|
committer | Andrew Gerrand <adg@golang.org> | 2013-07-23 09:50:35 +1000 |
commit | ceeda72babae48ab2dd25875497299d0dcbbd20d (patch) | |
tree | 000ccbcef00e3907d6d2a941a102e9a1d9ceadc8 | |
parent | fc9a18f16bd4c133ddb60aded9901fd53ccb042d (diff) | |
download | go-ceeda72babae48ab2dd25875497299d0dcbbd20d.tar.gz go-ceeda72babae48ab2dd25875497299d0dcbbd20d.zip |
[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
-rw-r--r-- | src/pkg/runtime/proc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c index 5734509e0c..9ad2ea091b 100644 --- a/src/pkg/runtime/proc.c +++ b/src/pkg/runtime/proc.c @@ -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); } |