Skip to content

Commit 489917f

Browse files
cagedmantisgopherbot
authored andcommitted
Revert "runtime: only poll network from one P at a time in findRunnable"
This reverts commit 352dd2d. 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 <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> Reviewed-by: Mauri de Souza Meneguzzo <[email protected]> Auto-Submit: Carlos Amedee <[email protected]>
1 parent 83b5352 commit 489917f

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/runtime/proc.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3387,12 +3387,8 @@ top:
33873387
// blocked thread (e.g. it has already returned from netpoll, but does
33883388
// not set lastpoll yet), this thread will do blocking netpoll below
33893389
// anyway.
3390-
// We only poll from one thread at a time to avoid kernel contention
3391-
// on machines with many cores.
3392-
if netpollinited() && netpollAnyWaiters() && sched.lastpoll.Load() != 0 && sched.pollingNet.Swap(1) == 0 {
3393-
list, delta := netpoll(0)
3394-
sched.pollingNet.Store(0)
3395-
if !list.empty() { // non-blocking
3390+
if netpollinited() && netpollAnyWaiters() && sched.lastpoll.Load() != 0 {
3391+
if list, delta := netpoll(0); !list.empty() { // non-blocking
33963392
gp := list.pop()
33973393
injectglist(&list)
33983394
netpollAdjustWaiters(delta)

src/runtime/runtime2.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -756,10 +756,9 @@ type p struct {
756756
}
757757

758758
type schedt struct {
759-
goidgen atomic.Uint64
760-
lastpoll atomic.Int64 // time of last network poll, 0 if currently polling
761-
pollUntil atomic.Int64 // time to which current poll is sleeping
762-
pollingNet atomic.Int32 // 1 if some P doing non-blocking network poll
759+
goidgen atomic.Uint64
760+
lastpoll atomic.Int64 // time of last network poll, 0 if currently polling
761+
pollUntil atomic.Int64 // time to which current poll is sleeping
763762

764763
lock mutex
765764

0 commit comments

Comments
 (0)