]> Cypherpunks repositories - gostls13.git/commitdiff
Revert "runtime: only poll network from one P at a time in findRunnable"
authorCarlos Amedee <carlos@golang.org>
Tue, 22 Apr 2025 20:42:26 +0000 (13:42 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 22 Apr 2025 22:49:52 +0000 (15:49 -0700)
This reverts commit 352dd2d932c1c1c6dbc3e112fcdfface07d4fffb.

Reason for revert: cockroachdb benchmark failing. Likely due to CL 564197.

For #73474

Change-Id: Id5d83cd8bb8fe9ee7fddb8dc01f1a01f2d40154e
Reviewed-on: https://go-review.googlesource.com/c/go/+/667336
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Auto-Submit: Carlos Amedee <carlos@golang.org>

src/runtime/proc.go
src/runtime/runtime2.go

index 44c6d0b4e43ca3a3e9202c5df620bc4d3a8e60aa..db7a5b2bb1c654568139595b070de4c9dab24c3f 100644 (file)
@@ -3387,12 +3387,8 @@ top:
        // blocked thread (e.g. it has already returned from netpoll, but does
        // not set lastpoll yet), this thread will do blocking netpoll below
        // anyway.
-       // We only poll from one thread at a time to avoid kernel contention
-       // on machines with many cores.
-       if netpollinited() && netpollAnyWaiters() && sched.lastpoll.Load() != 0 && sched.pollingNet.Swap(1) == 0 {
-               list, delta := netpoll(0)
-               sched.pollingNet.Store(0)
-               if !list.empty() { // non-blocking
+       if netpollinited() && netpollAnyWaiters() && sched.lastpoll.Load() != 0 {
+               if list, delta := netpoll(0); !list.empty() { // non-blocking
                        gp := list.pop()
                        injectglist(&list)
                        netpollAdjustWaiters(delta)
index f7371c450bd93c5007b0bc4a80d0a38856bde67e..05cf345baf6431cf0b6ba8e13d1b0100875183ad 100644 (file)
@@ -756,10 +756,9 @@ type p struct {
 }
 
 type schedt struct {
-       goidgen    atomic.Uint64
-       lastpoll   atomic.Int64 // time of last network poll, 0 if currently polling
-       pollUntil  atomic.Int64 // time to which current poll is sleeping
-       pollingNet atomic.Int32 // 1 if some P doing non-blocking network poll
+       goidgen   atomic.Uint64
+       lastpoll  atomic.Int64 // time of last network poll, 0 if currently polling
+       pollUntil atomic.Int64 // time to which current poll is sleeping
 
        lock mutex