File tree 2 files changed +5
-10
lines changed 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -3387,12 +3387,8 @@ top:
3387
3387
// blocked thread (e.g. it has already returned from netpoll, but does
3388
3388
// not set lastpoll yet), this thread will do blocking netpoll below
3389
3389
// 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
3396
3392
gp := list .pop ()
3397
3393
injectglist (& list )
3398
3394
netpollAdjustWaiters (delta )
Original file line number Diff line number Diff line change @@ -756,10 +756,9 @@ type p struct {
756
756
}
757
757
758
758
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
763
762
764
763
lock mutex
765
764
You can’t perform that action at this time.
0 commit comments