aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2020-12-22 16:54:51 -0500
committerRuss Cox <rsc@golang.org>2020-12-22 16:55:15 -0500
commitec741b04470cda8df5902f1d8d84ab15cb2c8b8b (patch)
tree06682f85c7951b2a94423c01ea6008af4d558053 /src/runtime/proc.go
parentacc32ea124957ad4b097186fb2f6da8122a9a5d1 (diff)
parentc9fb4eb0a22131cc9922fa96afba01d4e21d4fd4 (diff)
downloadgo-ec741b04470cda8df5902f1d8d84ab15cb2c8b8b.tar.xz
[dev.regabi] all: merge master (c9fb4eb) into dev.regabi
Merge List: * 2020-12-22 c9fb4eb0a2 cmd/link: handle grouped resource sections * 2020-12-22 c06a354bcc test: trigger SIGSEGV instead of SIGTRAP in issue11656.go * 2020-12-22 0aa9b4709a cmd/pack: r command create output file if not exist * 2020-12-22 4d27c4c223 runtime: correct error handling in several FreeBSD syscall wrappers * 2020-12-22 9b6147120a cmd/pack: treat compiler's -linkobj output as "compiler object" * 2020-12-21 bc7e4d9257 syscall: don't generate ptrace on iOS * 2020-12-21 6cff874c47 runtime/metrics: add Read examples * 2020-12-21 8438a5779b runtime: use _exit on darwin * 2020-12-21 cb95819cf6 runtime: detect netbsd netpoll overrun in sysmon * 2020-12-21 53c984d976 runtime: skip wakep call in wakeNetPoller on Plan 9 * 2020-12-21 9abbe27710 test: skip issue11656.go on mips/mips64/ppc64 Change-Id: Ibb235fbf6a86ebcf50c686dc11f7c02d1865f845
Diffstat (limited to 'src/runtime/proc.go')
-rw-r--r--src/runtime/proc.go24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index 64e102fb0a..5adcbf07dc 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -2882,7 +2882,9 @@ func wakeNetPoller(when int64) {
} else {
// There are no threads in the network poller, try to get
// one there so it can handle new timers.
- wakep()
+ if GOOS != "plan9" { // Temporary workaround - see issue #42303.
+ wakep()
+ }
}
}
@@ -5128,6 +5130,26 @@ func sysmon() {
}
}
mDoFixup()
+ if GOOS == "netbsd" {
+ // netpoll is responsible for waiting for timer
+ // expiration, so we typically don't have to worry
+ // about starting an M to service timers. (Note that
+ // sleep for timeSleepUntil above simply ensures sysmon
+ // starts running again when that timer expiration may
+ // cause Go code to run again).
+ //
+ // However, netbsd has a kernel bug that sometimes
+ // misses netpollBreak wake-ups, which can lead to
+ // unbounded delays servicing timers. If we detect this
+ // overrun, then startm to get something to handle the
+ // timer.
+ //
+ // See issue 42515 and
+ // https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=50094.
+ if next, _ := timeSleepUntil(); next < now {
+ startm(nil, false)
+ }
+ }
if atomic.Load(&scavenge.sysmonWake) != 0 {
// Kick the scavenger awake if someone requested it.
wakeScavenger()