On Fri, Jul 26, 2024 at 10:00:56AM +0200, Stefano Brivio wrote: > On Fri, 26 Jul 2024 17:20:29 +1000 > David Gibson wrote: > > > Currently we set EPOLLET (edge trigger) on the epoll flags for the > > connected Qemu Unix socket. It's not clear that there's a reason for > > doing this: for TCP sockets we need to use EPOLLET, because we leave data > > in the socket buffers for our flow control handling. That consideration > > doesn't apply to the way we handle the qemu socket however. > > It significantly decreases epoll_wait() overhead on sustained data > transfers, because we can read multiple TAP_BUF_SIZE buffers at a time > instead of just one. That's a reason to keep the loop, but not EPOLLET itself, AFAICT. I'd be happy enough to put the loop back in as an optimization (although, I'd prefer to avoid the goto). > I can check that now again with current QEMU and kernel versions, plus > several fundamental changes in buffer handling, but I don't see a real > reason why this shouldn't have changed meanwhile. -- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson