From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCSSb-0001ht-3Q for qemu-devel@nongnu.org; Thu, 01 Dec 2016 09:35:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cCSSX-0000o1-6q for qemu-devel@nongnu.org; Thu, 01 Dec 2016 09:35:41 -0500 Received: from mx5-phx2.redhat.com ([209.132.183.37]:45664) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cCSSW-0000n4-Uq for qemu-devel@nongnu.org; Thu, 01 Dec 2016 09:35:37 -0500 Date: Thu, 1 Dec 2016 09:35:27 -0500 (EST) From: Paolo Bonzini Message-ID: <1469768236.987810.1480602927225.JavaMail.zimbra@redhat.com> In-Reply-To: <9b1bf34e-e33b-777d-ef02-00b50b03440f@scylladb.com> References: <20161124151225.GA11963@stefanha-x1.localdomain> <325f739a-05bd-c437-b9a2-e371a8cbf50d@linux.intel.com> <20161128152921.GA11196@stefanha-x1.localdomain> <73fa904a-7064-d692-6e8d-39161eaa8786@redhat.com> <20161129104505.GA1300@stefanha-x1.localdomain> <32e560b9-779a-3cd9-9320-2faf68e00107@scylladb.com> <20161201114529.GA10441@stefanha-x1.localdomain> <9b1bf34e-e33b-777d-ef02-00b50b03440f@scylladb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Linux kernel polling for QEMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Stefan Hajnoczi , Willem de Bruijn , Fam Zheng , Eliezer Tamir , Eric Dumazet , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Jens Axboe , Christian Borntraeger , Davide Libenzi , Christoph Hellwig > > > Maybe we could do the same for sockets? When data is available on a > > > socket (or when it becomes writable), write to a user memory location. > > > > > > I, too, have an interest in polling; in my situation most of the polling > > > happens in userspace. > > > > You are trying to improve on the latency of non-blocking > > ppoll(2)/epoll_wait(2) call? > > Yes, but the concern is for throughput, not latency. > > My main loop looks like > > execute some tasks > poll from many sources > > Since epoll_wait(..., 0) has non-trivial costs, I have to limit the > polling rate, and even so it shows up in the profile. If the cost were > lower, I could poll at a higher frequency, resulting in lower worst-case > latencies for high-priority tasks. IMHO, the ideal model wouldn't enter the kernel at all unless you _want_ to go to sleep. Paolo