]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: drop NetBSD kernel bug sysmon workaround fixed in NetBSD 9.2
authorTobias Klauser <tklauser@distanz.ch>
Fri, 11 Jul 2025 20:59:10 +0000 (22:59 +0200)
committerGopher Robot <gobot@golang.org>
Thu, 24 Jul 2025 16:01:30 +0000 (09:01 -0700)
The NetBSD releases supported by the NetBSD project as off today are 9.4
and 10.1. The Go project's NetBSD builders are on 9.3. Thus, it is fine
to drop the workaround which was only needed for NetBSD before 9.2.

Fixes #46495

Cq-Include-Trybots: luci.golang.try:gotip-netbsd-arm64
Change-Id: I3c2ec42fb0f08f7dafdfb7f1dbd97853afc16386
Reviewed-on: https://go-review.googlesource.com/c/go/+/687735
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Auto-Submit: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/runtime/os_netbsd.go
src/runtime/proc.go

index 10b14a87185fb600a4c8e2f8afcff57ce81477f6..f117253f34abb4876edc2b568b4fda6b3bbeb9df 100644 (file)
@@ -101,9 +101,6 @@ var sigset_all = sigset{[4]uint32{^uint32(0), ^uint32(0), ^uint32(0), ^uint32(0)
 
 // From NetBSD's <sys/sysctl.h>
 const (
-       _CTL_KERN   = 1
-       _KERN_OSREV = 3
-
        _CTL_HW        = 6
        _HW_NCPU       = 3
        _HW_PAGESIZE   = 7
@@ -141,13 +138,6 @@ func getPageSize() uintptr {
        return 0
 }
 
-func getOSRev() int {
-       if osrev, ok := sysctlInt([]uint32{_CTL_KERN, _KERN_OSREV}); ok {
-               return int(osrev)
-       }
-       return 0
-}
-
 //go:nosplit
 func semacreate(mp *m) {
 }
@@ -268,7 +258,6 @@ func osinit() {
        if physPageSize == 0 {
                physPageSize = getPageSize()
        }
-       needSysmonWorkaround = getOSRev() < 902000000 // NetBSD 9.2
 }
 
 var urandom_dev = []byte("/dev/urandom\x00")
index b41bbe93cf57c755274bc4b18c47e875d8635da4..9715f5689008e604160b207b1f45060d94425d3b 100644 (file)
@@ -6199,10 +6199,6 @@ 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
-
 // haveSysmon indicates whether there is sysmon thread support.
 //
 // No threads on wasm yet, so no sysmon.
@@ -6311,26 +6307,6 @@ func sysmon() {
                                netpollAdjustWaiters(delta)
                        }
                }
-               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
-                       // 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, false)
-                       }
-               }
                // Check if we need to update GOMAXPROCS at most once per second.
                if debug.updatemaxprocs != 0 && lastgomaxprocs+1e9 <= now {
                        sysmonUpdateGOMAXPROCS()