Skip to content

Commit 52b6d7f

Browse files
tklausergopherbot
authored andcommitted
runtime: drop NetBSD kernel bug sysmon workaround fixed in NetBSD 9.2
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 <[email protected]> Auto-Submit: Benny Siegert <[email protected]> Reviewed-by: Benny Siegert <[email protected]> Reviewed-by: Michael Pratt <[email protected]> Reviewed-by: Cherry Mui <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 1ebebf1 commit 52b6d7f

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

src/runtime/os_netbsd.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ var sigset_all = sigset{[4]uint32{^uint32(0), ^uint32(0), ^uint32(0), ^uint32(0)
101101

102102
// From NetBSD's <sys/sysctl.h>
103103
const (
104-
_CTL_KERN = 1
105-
_KERN_OSREV = 3
106-
107104
_CTL_HW = 6
108105
_HW_NCPU = 3
109106
_HW_PAGESIZE = 7
@@ -141,13 +138,6 @@ func getPageSize() uintptr {
141138
return 0
142139
}
143140

144-
func getOSRev() int {
145-
if osrev, ok := sysctlInt([]uint32{_CTL_KERN, _KERN_OSREV}); ok {
146-
return int(osrev)
147-
}
148-
return 0
149-
}
150-
151141
//go:nosplit
152142
func semacreate(mp *m) {
153143
}
@@ -268,7 +258,6 @@ func osinit() {
268258
if physPageSize == 0 {
269259
physPageSize = getPageSize()
270260
}
271-
needSysmonWorkaround = getOSRev() < 902000000 // NetBSD 9.2
272261
}
273262

274263
var urandom_dev = []byte("/dev/urandom\x00")

src/runtime/proc.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6199,10 +6199,6 @@ func checkdead() {
61996199
// This is a variable for testing purposes. It normally doesn't change.
62006200
var forcegcperiod int64 = 2 * 60 * 1e9
62016201

6202-
// needSysmonWorkaround is true if the workaround for
6203-
// golang.org/issue/42515 is needed on NetBSD.
6204-
var needSysmonWorkaround bool = false
6205-
62066202
// haveSysmon indicates whether there is sysmon thread support.
62076203
//
62086204
// No threads on wasm yet, so no sysmon.
@@ -6311,26 +6307,6 @@ func sysmon() {
63116307
netpollAdjustWaiters(delta)
63126308
}
63136309
}
6314-
if GOOS == "netbsd" && needSysmonWorkaround {
6315-
// netpoll is responsible for waiting for timer
6316-
// expiration, so we typically don't have to worry
6317-
// about starting an M to service timers. (Note that
6318-
// sleep for timeSleepUntil above simply ensures sysmon
6319-
// starts running again when that timer expiration may
6320-
// cause Go code to run again).
6321-
//
6322-
// However, netbsd has a kernel bug that sometimes
6323-
// misses netpollBreak wake-ups, which can lead to
6324-
// unbounded delays servicing timers. If we detect this
6325-
// overrun, then startm to get something to handle the
6326-
// timer.
6327-
//
6328-
// See issue 42515 and
6329-
// https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=50094.
6330-
if next := timeSleepUntil(); next < now {
6331-
startm(nil, false, false)
6332-
}
6333-
}
63346310
// Check if we need to update GOMAXPROCS at most once per second.
63356311
if debug.updatemaxprocs != 0 && lastgomaxprocs+1e9 <= now {
63366312
sysmonUpdateGOMAXPROCS()

0 commit comments

Comments
 (0)