From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=44140 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGpoS-0001RA-NQ for qemu-devel@nongnu.org; Fri, 12 Nov 2010 04:20:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PGpoN-0003GG-PM for qemu-devel@nongnu.org; Fri, 12 Nov 2010 04:20:52 -0500 Received: from mail-ww0-f53.google.com ([74.125.82.53]:58366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PGpoN-0003G5-Kw for qemu-devel@nongnu.org; Fri, 12 Nov 2010 04:20:47 -0500 Received: by wwe15 with SMTP id 15so2146370wwe.10 for ; Fri, 12 Nov 2010 01:20:47 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20101111164518.GA28773@infradead.org> References: <1289483242-6069-1-git-send-email-stefanha@linux.vnet.ibm.com> <1289483242-6069-3-git-send-email-stefanha@linux.vnet.ibm.com> <20101111164518.GA28773@infradead.org> Date: Fri, 12 Nov 2010 09:20:46 +0000 Message-ID: Subject: Re: [Qemu-devel] Re: [PATCH 2/3] virtio-pci: Use ioeventfd for virtqueue notify From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: "Michael S. Tsirkin" , Stefan Hajnoczi , kvm@vger.kernel.org, qemu-devel@nongnu.org On Thu, Nov 11, 2010 at 4:45 PM, Christoph Hellwig wrot= e: > On Thu, Nov 11, 2010 at 01:47:21PM +0000, Stefan Hajnoczi wrote: >> Some virtio devices are known to have guest drivers which expect a notif= y to be >> processed synchronously and spin waiting for completion. =A0Only enable = ioeventfd >> for virtio-blk and virtio-net for now. > > Who guarantees that less common virtio-blk and virtio-net guest drivers > for non-Linux OSes are fine with it? =A0Maybe you should add a feature fl= ag > that the guest has to ACK to enable it. Virtio-blk and virtio-net are fine. Both of those devices are expected to operate asynchronously. SeaBIOS and gPXE virtio-net drivers spin but they expect to and it is okay in those environments. They already burn CPU today. Virtio-console expects synchronous virtqueue kick. In Linux, virtio_console.c __send_control_msg() and send_buf() will spin. Qemu userspace is able to complete those requests synchronously so that the guest never actually burns CPU (e.g. hw/virtio-serial-bus.c:send_control_msg()). I don't want to burn CPU in places where we previously didn't. It's good that QEMU can decide whether or not to handle virtqueue kick in the vcpu thread. For high performance asynchronous devices like virtio-net and virtio-blk it makes sense to use ioeventfd. For others it may not be useful. I'm not sure a feature bit that exposes this detail to the guest would be useful. Stefan