mirror of
https://github.com/golang/go.git
synced 2025-10-19 11:03:18 +00:00
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 <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>
This commit is contained in:
parent
1ebebf1cc1
commit
52b6d7f67a
2 changed files with 0 additions and 35 deletions
|
@ -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")
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue