]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: use osyield in runqgrab on netbsd
authorMichael Anthony Knyszek <mknyszek@google.com>
Wed, 18 May 2022 23:47:03 +0000 (23:47 +0000)
committerMichael Knyszek <mknyszek@google.com>
Thu, 19 May 2022 14:18:41 +0000 (14:18 +0000)
NetBSD appears to have the same issue OpenBSD had in runqgrab. See
issue #52475 for more details.

For #35166.

Change-Id: Ie53192d26919b4717bc0d61cadd88d688ff38bb4
Reviewed-on: https://go-review.googlesource.com/c/go/+/407139
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/proc.go

index f5e528e8e9b60d305bf40d4008e45a8c23acdade..7ac6279c4033ead175b3fceba9053f955dc3fb5b 100644 (file)
@@ -5955,7 +5955,7 @@ func runqgrab(_p_ *p, batch *[256]guintptr, batchHead uint32, stealRunNextG bool
                                                // between different Ps.
                                                // A sync chan send/recv takes ~50ns as of time of
                                                // writing, so 3us gives ~50x overshoot.
-                                               if GOOS != "windows" && GOOS != "openbsd" {
+                                               if GOOS != "windows" && GOOS != "openbsd" && GOOS != "netbsd" {
                                                        usleep(3)
                                                } else {
                                                        // On some platforms system timer granularity is