diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2021-06-03 16:57:54 +0200 |
---|---|---|
committer | Tobias Klauser <tobias.klauser@gmail.com> | 2021-08-16 21:24:44 +0000 |
commit | 6406227d71d2de0bec944bfc1a6aaed90dbf9d0d (patch) | |
tree | 5d57ae62cfd2148e448f190a88b919acac98255c /src/runtime/proc.go | |
parent | a05a7d49a9b7975d89bc5851cff55b64f64242c3 (diff) | |
download | go-6406227d71d2de0bec944bfc1a6aaed90dbf9d0d.tar.gz go-6406227d71d2de0bec944bfc1a6aaed90dbf9d0d.zip |
runtime: skip sysmon workaround on NetBSD >= 9.2
Detect the NetBSD version in osinit and only enable the workaround for
the kernel bug identified in #42515 for NetBSD versions older than 9.2.
For #42515
For #46495
Change-Id: I808846c7f8e47e5f7cc0a2f869246f4bd90d8e22
Reviewed-on: https://go-review.googlesource.com/c/go/+/324472
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Trust: Benny Siegert <bsiegert@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/runtime/proc.go')
-rw-r--r-- | src/runtime/proc.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go index cde1a11583..c2e43ef5c3 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -5229,6 +5229,10 @@ func checkdead() { // This is a variable for testing purposes. It normally doesn't change. var forcegcperiod int64 = 2 * 60 * 1e9 +// needSysmonWorkaround is true if the workaround for +// golang.org/issue/42515 is needed on NetBSD. +var needSysmonWorkaround bool = false + // Always runs without a P, so write barriers are not allowed. // //go:nowritebarrierrec @@ -5337,7 +5341,7 @@ func sysmon() { } } mDoFixup() - if GOOS == "netbsd" { + if GOOS == "netbsd" && needSysmonWorkaround { // 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 |