From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTudq-0005z2-9H for qemu-devel@nongnu.org; Mon, 24 Aug 2015 12:30:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZTudm-0002nt-2O for qemu-devel@nongnu.org; Mon, 24 Aug 2015 12:30:38 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:46533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTudl-0002my-Qi for qemu-devel@nongnu.org; Mon, 24 Aug 2015 12:30:34 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 24 Aug 2015 17:30:32 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id B7FA517D805A for ; Mon, 24 Aug 2015 17:32:07 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t7OGUTxo31522958 for ; Mon, 24 Aug 2015 16:30:29 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t7OGUT4L007816 for ; Mon, 24 Aug 2015 10:30:29 -0600 Date: Mon, 24 Aug 2015 18:30:26 +0200 From: Greg Kurz Message-ID: <20150824183026.413e37a3@bahia.local> In-Reply-To: <1440147950-1178-5-git-send-email-jasowang@redhat.com> References: <1440147950-1178-1-git-send-email-jasowang@redhat.com> <1440147950-1178-5-git-send-email-jasowang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/6] virtio-pci: use wildcard mmio eventfd for 1.0 notification cap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang Cc: qemu-devel@nongnu.org, mst@redhat.com On Fri, 21 Aug 2015 17:05:48 +0800 Jason Wang wrote: > We use data match eventfd for 1.0 notification currently. This could > be slow since software decoding is needed for mmio exit. To speed this > up, we can switch to use wild card mmio eventfd for 1.0 notification > since we can examine the queue index directly from the writing > address. KVM kernel module can utilize this by registering it to fast > mmio bus which could be as fast as pio on ept capable machine. > > Lots of improvements were seen on a ept capable machine: > > Guest RX:(TCP) > size/session/+throughput%/+cpu%/-+per cpu%/ > 64/1/+1.6807%/[-16.2421%]/[+21.3984%]/ > 64/2/+0.6091%/[-11.0187%]/[+13.0678%]/ > 64/4/+0.0553%/[-5.9768%]/[+6.4155%]/ > 64/8/+0.1206%/[-4.0057%]/[+4.2984%]/ > 256/1/-0.0031%/[-10.1166%]/[+11.2517%]/ > 256/2/-0.5058%/[-6.1656%]/+6.0317%]/ > ... > > Guest TX:(TCP) > size/session/+throughput%/+cpu%/-+per cpu%/ > 64/1/[+18.9183%]/-0.2823%/[+19.2550%]/ > 64/2/[+13.5714%]/[+2.2675%]/[+11.0533%]/ > 64/4/[+13.1070%]/[+2.1817%]/[+10.6920%]/ > 64/8/[+13.0426%]/[+2.0887%]/[+10.7299%]/ > 256/1/[+36.2761%]/+6.3434%/[+28.1471%]/ > ... > 1024/1/[+44.8873%]/+2.0811%/[+41.9335%]/ > ... > 1024/4/+0.0228%/[-2.2044%]/[+2.2774%]/ > ... > 16384/2/+0.0127%/[-5.0346%]/[+5.3148%]/ > ... > 65535/1/[+0.0062%]/[-4.1183%]/[+4.3017%]/ > 65535/2/+0.0004%/[-4.2311%]/[+4.4185%]/ > 65535/4/+0.0107%/[-4.6106%]/[+4.8446%]/ > 65535/8/-0.0090%/[-5.5178%]/[+5.8306%]/ > > Latency:(TCP_RR) > size/session/+transaction rate%/+cpu%/-+per cpu%/ > 64/1/[+6.5248%]/[-9.2882%]/[+17.4322%]/ > 64/25/[+11.0854%]/[+0.8000%]/[+10.2038%]/ > 64/50/[+12.1076%]/[+2.4627%]/[+9.4131%]/ > 256/1/[+5.3677%]/[+10.5669%]/-4.7024%/ > 256/25/[+5.6402%]/-0.8962%/[+6.5955%]/ > 256/50/[+5.9685%]/[+1.7766%]/[+4.1188%]/ > 4096/1/+0.2508%/[-10.4941%]/[+12.0047%]/ > 4096/25/[+1.8533%]/-0.0273%/+1.8812%/ > 4096/50/[+1.2156%]/-1.4134%/+2.6667%/ > > Notes: data with '[]' is the one whose significance is greater than 95%. > > Thanks Wenli Quan for the benchmarking. > > Cc: Michael S. Tsirkin > Signed-off-by: Jason Wang > --- > hw/virtio/virtio-pci.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c > index d785623..fbd1f1f 100644 > --- a/hw/virtio/virtio-pci.c > +++ b/hw/virtio/virtio-pci.c > @@ -226,8 +226,8 @@ static int virtio_pci_set_host_notifier_internal(VirtIOPCIProxy *proxy, > } > virtio_queue_set_host_notifier_fd_handler(vq, true, set_handler); > if (modern) { > - memory_region_add_eventfd(modern_mr, modern_addr, 2, > - true, n, notifier); > + memory_region_add_eventfd(modern_mr, modern_addr, 0, > + false, n, notifier); This calls for the following change in memory.c: static void adjust_endianness(MemoryRegion *mr, uint64_t *data, unsigned size) { - if (memory_region_wrong_endianness(mr)) { + if (size && memory_region_wrong_endianness(mr)) { otherwise we abort on PPC64. > } > if (legacy) { > memory_region_add_eventfd(legacy_mr, legacy_addr, 2, > @@ -235,8 +235,8 @@ static int virtio_pci_set_host_notifier_internal(VirtIOPCIProxy *proxy, > } > } else { > if (modern) { > - memory_region_del_eventfd(modern_mr, modern_addr, 2, > - true, n, notifier); > + memory_region_del_eventfd(modern_mr, modern_addr, 0, > + false, n, notifier); > } > if (legacy) { > memory_region_del_eventfd(legacy_mr, legacy_addr, 2,