From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSkHi-00077p-Uz for qemu-devel@nongnu.org; Wed, 26 Mar 2014 05:38:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSkHa-00072x-1m for qemu-devel@nongnu.org; Wed, 26 Mar 2014 05:38:10 -0400 Received: from mail-ee0-x236.google.com ([2a00:1450:4013:c00::236]:46750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSkHZ-00072D-NQ for qemu-devel@nongnu.org; Wed, 26 Mar 2014 05:38:01 -0400 Received: by mail-ee0-f54.google.com with SMTP id d49so1420129eek.13 for ; Wed, 26 Mar 2014 02:38:00 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53329FF2.5040706@redhat.com> Date: Wed, 26 Mar 2014 10:37:54 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <33183CC9F5247A488A2544077AF19020815DA9BD@SZXEMA503-MBS.china.huawei.com> <53317892.2050506@redhat.com> <33183CC9F5247A488A2544077AF19020815DAEBA@SZXEMA503-MBS.china.huawei.com> In-Reply-To: <33183CC9F5247A488A2544077AF19020815DAEBA@SZXEMA503-MBS.china.huawei.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC]Two ideas to optimize updating irq routing table List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gonglei (Arei)" , "qemu-devel@nongnu.org" , "kvm@vger.kernel.org" Cc: "Huangweidong (C)" , "gleb@redhat.com" , "mst@redhat.com" , Christian Borntraeger , "avi.kivity@gmail.com" , "Herongguang (Stephen)" Il 26/03/2014 09:22, Gonglei (Arei) ha scritto: > Yes, previously I was using synchronize_srcu, which is not good. When I > changed it to synchronize_srcu_expedited, grace period delay is much better > than synchronize_srcu. Though in our tests, we can still see some impact > of KVM_SET_GSI_ROUTING ioctl. > > Our testing scenario is like this. In VM we run a script that sets smp_affinity > for each IRQ every 0.5s (this leads QEMU to do KVM_SET_GSI_ROUTING ioctl). > Outside the VM we ping that VM. Does the affinity actually change every 0.5s? > Without patches, ping time can jump from 0.3ms to 2ms-30ms. With synchronize_srcu > patch, ping time is worse. With synchronize_srcu_expedited patch, ping time is > overall good, though sometimes ping time jump to 1ms-3ms. > > With following raw patch, ping time is like call_rcu patch, that not influenced > by setting IRQ affinity, keeps 0.3ms, and there is no vulnerability, frequent > intermidiate KVM_SET_GSI_ROUTING settings are just skipped, and always the newest > setting would take effect. Interesting, but it only works for assigned-dev.c which is deprecated. If you used VFIO you'd see no improvement, and Christian's s390 usecase would also see no improvement. Paolo