From patchwork Tue Oct 11 10:41:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 118917 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5B961B6F65 for ; Tue, 11 Oct 2011 21:42:18 +1100 (EST) Received: from localhost ([::1]:36114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDZmn-00025e-Nl for incoming@patchwork.ozlabs.org; Tue, 11 Oct 2011 06:42:13 -0400 Received: from eggs.gnu.org ([140.186.70.92]:41680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDZmg-00025M-W0 for qemu-devel@nongnu.org; Tue, 11 Oct 2011 06:42:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RDZmf-0001Kg-E8 for qemu-devel@nongnu.org; Tue, 11 Oct 2011 06:42:06 -0400 Received: from e23smtp06.au.ibm.com ([202.81.31.148]:50552) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDZme-0001Jz-Tj for qemu-devel@nongnu.org; Tue, 11 Oct 2011 06:42:05 -0400 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245]) by e23smtp06.au.ibm.com (8.14.4/8.13.1) with ESMTP id p9BAedEb007402 for ; Tue, 11 Oct 2011 21:40:39 +1100 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p9BAfpMM2089190 for ; Tue, 11 Oct 2011 21:41:51 +1100 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p9BAfoWK022635 for ; Tue, 11 Oct 2011 21:41:51 +1100 Received: from skywalker.in.ibm.com ([9.124.35.48]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p9BAfmOX022595; Tue, 11 Oct 2011 21:41:50 +1100 From: "Aneesh Kumar K.V" To: qemu-devel@nongnu.org Date: Tue, 11 Oct 2011 16:11:33 +0530 Message-Id: <1318329705-3179-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1318329705-3179-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1318329705-3179-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 202.81.31.148 Cc: aliguori@us.ibm.com, "Aneesh Kumar K.V" Subject: [Qemu-devel] [PATCH -V2 01/13] hw/9pfs: Use ioeventfd for 9p X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Aneesh Kumar K.V" With ioeventfd: [root@qemu-img-64 storage]# dd if=/dev/zero of=/storage/testx bs=8k count=131072 oflag=direct 131072+0 records in 131072+0 records out 1073741824 bytes (1.1 GB) copied, 26.767 s, 40.1 MB/s Without: [root@qemu-img-64 storage]# dd if=/dev/zero of=/storage/testx bs=8k count=131072 oflag=direct 131072+0 records in 131072+0 records out 1073741824 bytes (1.1 GB) copied, 65.3361 s, 16.4 MB/s Reviewed-by: Stefan Hajnoczi Signed-off-by: Aneesh Kumar K.V --- hw/9pfs/virtio-9p-device.c | 2 ++ hw/virtio-pci.c | 5 ----- hw/virtio-pci.h | 5 +++++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c index 513e181..e5b68da 100644 --- a/hw/9pfs/virtio-9p-device.c +++ b/hw/9pfs/virtio-9p-device.c @@ -169,6 +169,8 @@ static PCIDeviceInfo virtio_9p_info = { .revision = VIRTIO_PCI_ABI_VERSION, .class_id = 0x2, .qdev.props = (Property[]) { + DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags, + VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true), DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2), DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features), DEFINE_PROP_STRING("mount_tag", VirtIOPCIProxy, fsconf.tag), diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index df27c19..ca5923c 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -83,11 +83,6 @@ /* Flags track per-device state like workarounds for quirks in older guests. */ #define VIRTIO_PCI_FLAG_BUS_MASTER_BUG (1 << 0) -/* Performance improves when virtqueue kick processing is decoupled from the - * vcpu thread using ioeventfd for some devices. */ -#define VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT 1 -#define VIRTIO_PCI_FLAG_USE_IOEVENTFD (1 << VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT) - /* QEMU doesn't strictly need write barriers since everything runs in * lock-step. We'll leave the calls to wmb() in though to make it obvious for * KVM or if kqemu gets SMP support. diff --git a/hw/virtio-pci.h b/hw/virtio-pci.h index 14c10f7..f8404de 100644 --- a/hw/virtio-pci.h +++ b/hw/virtio-pci.h @@ -18,6 +18,11 @@ #include "virtio-net.h" #include "virtio-serial.h" +/* Performance improves when virtqueue kick processing is decoupled from the + * vcpu thread using ioeventfd for some devices. */ +#define VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT 1 +#define VIRTIO_PCI_FLAG_USE_IOEVENTFD (1 << VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT) + typedef struct { PCIDevice pci_dev; VirtIODevice *vdev;