mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
netstack: use unix.Syscall instead of BlockingPoll
unix.Syscall increases throughput and decreases CPU usage.
```
│ /tmp/old.log │ /tmp/new.log │
│ Mb/s │ Mb/s vs base │
TCPClient/role=server/host-gso=true/host-gro=true 13.61k ± 2% 13.93k ± 1% +2.35% (p=0.000 n=10)
TCPClient/role=client/host-gso=true/host-gro=true 2.300k ± 1% 2.369k ± 1% +3.00% (p=0.000 n=10)
geomean 5.595k 5.745k +2.67%
│ /tmp/old.log │ /tmp/new.log │
│ cpu-time │ cpu-time vs base │
TCPClient/role=server/host-gso=true/host-gro=true 2.410 ± 0% 2.299 ± 1% -4.62% (p=0.000 n=10)
TCPClient/role=client/host-gso=true/host-gro=true 2.883 ± 0% 2.802 ± 1% -2.81% (p=0.000 n=10)
geomean 2.636 2.538 -3.72%
```
PiperOrigin-RevId: 540128696
This commit is contained in:
committed by
gVisor bot
parent
e5f2478bee
commit
30f3409d4f
@@ -245,7 +245,7 @@ func BlockingPollUntilStopped(efd int, fd int, events int16) (bool, unix.Errno)
|
||||
Events: events,
|
||||
},
|
||||
}
|
||||
_, errno := BlockingPoll(&pevents[0], len(pevents), nil)
|
||||
_, _, errno := unix.Syscall6(unix.SYS_PPOLL, uintptr(unsafe.Pointer(&pevents[0])), uintptr(len(pevents)), 0, 0, 0, 0)
|
||||
if errno != 0 {
|
||||
return pevents[0].Revents&unix.POLLIN != 0, errno
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user