From mboxrd@z Thu Jan 1 00:00:00 1970 From: "David S. Ahern" Subject: Re: [PATCH 5/6] kvm: qemu: virtio-net: handle all tx in I/O thread without timer Date: Thu, 06 Nov 2008 10:13:36 -0700 Message-ID: <491325C0.8000502@cisco.com> References: <> <1225389113-28332-1-git-send-email-markmc@redhat.com> <1225389113-28332-2-git-send-email-markmc@redhat.com> <1225389113-28332-3-git-send-email-markmc@redhat.com> <1225389113-28332-4-git-send-email-markmc@redhat.com> <1225389113-28332-5-git-send-email-markmc@redhat.com> <1225389113-28332-6-git-send-email-markmc@redhat.com> <491068ED.3020902@cisco.com> <1225990976.10879.34.camel@blaa> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm@vger.kernel.org To: Mark McLoughlin Return-path: Received: from sj-iport-3.cisco.com ([171.71.176.72]:29142 "EHLO sj-iport-3.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750812AbYKFRNi (ORCPT ); Thu, 6 Nov 2008 12:13:38 -0500 In-Reply-To: <1225990976.10879.34.camel@blaa> Sender: kvm-owner@vger.kernel.org List-ID: Mark McLoughlin wrote: > On Tue, 2008-11-04 at 08:23 -0700, David S. Ahern wrote: >> Mark McLoughlin wrote: >> >>> Note also that when tuning for a specific workload, which CPU >>> the I/O thread is pinned to is important. >>> >> Hi Mark: >> >> Can you give an example of when that has a noticeable affect? >> >> For example, if the guest handles network interrupts on vcpu0 and it is >> pinned to pcpu0 where should the IO thread be pinned for best performance? > > Basically, the I/O thread is where packets are copied too and from host > kernel space at the moment. > > If there are other copies of the packets anywhere, you want those to > copy from a cache. > > With my netperf guest->host benchmark, you actually have four copies > going on: > > 1) netperf process in guest copying to guest kernel space > > 2) qemu process in the host copying between internal buffers > > 3) qemu process in the host copying to host kernel space > > 4) netserver process in the host copying into its buffers > > My machine has four CPUs, with two 6Mb L2 caches - each cache is shared > between two of the CPUs, so I set things up as follows: > > pcpu#3 - netserver, I/O thread, vcpu#0 > pcup#4 - vcpu#1, virtio_net irq, netperf > > which (hopefully) ensures that we're only doing one copy using RAM and > the rest are using the L1/L2 caches. So, in other words you don't necessarily need the guest vcpu that handles the net irq on the same pcpu as the IO thread, but it should help to keep them within the same processor caches. Correct? david > > Cheers, > Mark. >