From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBfuT-0005KE-T5 for qemu-devel@nongnu.org; Tue, 29 Nov 2016 05:45:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBfuQ-000372-Qm for qemu-devel@nongnu.org; Tue, 29 Nov 2016 05:45:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48166) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cBfuQ-00036T-Km for qemu-devel@nongnu.org; Tue, 29 Nov 2016 05:45:10 -0500 Date: Tue, 29 Nov 2016 10:45:05 +0000 From: Stefan Hajnoczi Message-ID: <20161129104505.GA1300@stefanha-x1.localdomain> 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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3MwIy2ne0vdjdPXF" Content-Disposition: inline In-Reply-To: <73fa904a-7064-d692-6e8d-39161eaa8786@redhat.com> Subject: Re: [Qemu-devel] Linux kernel polling for QEMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Eliezer Tamir , Willem de Bruijn , Fam Zheng , Eric Dumazet , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Jens Axboe , Christian Borntraeger , Davide Libenzi , Christoph Hellwig --3MwIy2ne0vdjdPXF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 28, 2016 at 04:41:13PM +0100, Paolo Bonzini wrote: > On 28/11/2016 16:29, Stefan Hajnoczi wrote: > > Thanks for sharing the link. I'll let you know before embarking on an > > effort to make epoll support busy_loop. > >=20 > > At the moment I'm still evaluating whether the good results we've gotten > > from polling in QEMU userspace are preserved when polling is shifted to > > the kernel. > >=20 > > FWIW I've prototyped ioctl(EVENTFD_SET_POLL_INFO) but haven't had a > > chance to test it yet: > > https://github.com/stefanha/linux/commit/133e8f1da8eb5364cd5c5f7162decb= c79175cd13 >=20 > This would add a system call every time the main loop processes a vring, > wouldn't it? Yes, this is a problem and is the reason I haven't finished implementing a test using QEMU yet. My proposed eventfd polling mechanism doesn't work well with descriptor ring indices because the polling info needs to be updated each event loop iteration with the last seen ring index. This can be solved by making struct eventfd_poll_info.value take a userspace memory address. The value to compare against is fetched each polling iteration, avoiding the need for ioctl calls. Stefan --3MwIy2ne0vdjdPXF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJYPVwxAAoJEJykq7OBq3PIqEMH/j0XWgtFHeYua8EZLNqIxDas lJH90Dh0oztIokmep97ZdC9tx1x+G0XFWYtPuv4HRn6q/2Tsayjy2ptJ5V+N191Q SPfLiDcJlLEBwoecUWWC43iG/ogMm+U256z4Zbn2C1JFRbCWqx5LCOECQFmSu2XE uwUlYrU1pDnZ7ZKqNfI/6w17sq/z7JvaawNgiAKBF35tKeFg/QHhlGAhQqgbUz/3 K66cSjExxABp3B9MaGG+lp3h+jOfqktzK/YfHPAtds10repH+ewgiA2sPukNwswl W0MZcjlFyQSWPPxo1fMc/6WUjbigGfSWHe2bYvABUNp8viN9nihtuXeOvCfeoWQ= =YrsO -----END PGP SIGNATURE----- --3MwIy2ne0vdjdPXF--