E591 [release-branch.go1.1] runtime: prevent sysmon from polling network e… · golang/go@ceeda72 · GitHub
[go: up one dir, main page]

Skip to content

Commit ceeda72

Browse files
committed
[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
1 parent fc9a18f commit ceeda72

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/pkg/runtime/proc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,6 +2015,7 @@ sysmon(void)
20152015
lastpoll = runtime·atomicload64(&runtime·sched.lastpoll);
20162016
now = runtime·nanotime();
20172017
if(lastpoll != 0 && lastpoll + 10*1000*1000 > now) {
2018+
runtime·cas64(&runtime·sched.lastpoll, lastpoll, now);
20182019
gp = runtime·netpoll(false); // non-blocking
20192020
injectglist(gp);
20202021
}

0 commit comments

Comments
 (0)
0