Hi Ben,
> Hi all, > > I've started a patch to enable busy poll support for listener sockets. > It can be enabled by adding "busy-poll" in the bind line. For systems > that don't define SO_BUSY_POLL, building with the USE flag USE_BPS is > required. > > I built & tested this on a ubuntu trusty machine (3.13.0 kernel) and > verified with strace that the SO_BUSY_POLL socket is set (it shows up > as "0x2e /* SO_??? */", but I think that's fine). > > Unfortunately, I don't have access to hardware with a network device > that supports busy polling, so i'm not able to provide any benchmarks > at this time. :-/ We need someone to be able to test this, are you aware what nics currently support busy polling? What about loopback? > I look forward to everyones feedback on these changes. This seems to set busy polling unconditionally to 1 microsecond, I don't think thats a good idea. Perhaps this should be made configurable? Recommended value seem to be 50 or 100 us (see man 7 socket and [1])? Also, it looks to me like in this case we would also need to set the busy_poll sysctl (we don't do blocking receives)? If thats the case we will have to document it. As for the docs, I think we should at least mention that: - only certain nic drivers support busy polling - it will increases power usage - while busy_read sysctl is overwritten by the SO_BUSY_POLL socket option, busy_poll must be set at sysctl level [1] Also, we should probably check the return code of setsockopt() and give some feedback to the user whether the kernel accepted it, at the very least in verbose or debug mode. Are there some applications or poc's already using busy polling where we could take a look? Regards, Lukas [1] https://www.kernel.org/doc/Documentation/sysctl/net.txt

