From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [RFC]Two ideas to optimize updating irq routing table Date: Wed, 26 Mar 2014 10:37:54 +0100 Message-ID: <53329FF2.5040706@redhat.com> References: <33183CC9F5247A488A2544077AF19020815DA9BD@SZXEMA503-MBS.china.huawei.com> <53317892.2050506@redhat.com> <33183CC9F5247A488A2544077AF19020815DAEBA@SZXEMA503-MBS.china.huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "gleb@redhat.com" , "mst@redhat.com" , "avi.kivity@gmail.com" , "Herongguang (Stephen)" , "Huangweidong (C)" , Christian Borntraeger To: "Gonglei (Arei)" , "qemu-devel@nongnu.org" , "kvm@vger.kernel.org" Return-path: Received: from mail-ee0-f54.google.com ([74.125.83.54]:63951 "EHLO mail-ee0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750792AbaCZJiB (ORCPT ); Wed, 26 Mar 2014 05:38:01 -0400 Received: by mail-ee0-f54.google.com with SMTP id d49so1398276eek.41 for ; Wed, 26 Mar 2014 02:38:00 -0700 (PDT) In-Reply-To: <33183CC9F5247A488A2544077AF19020815DAEBA@SZXEMA503-MBS.china.huawei.com> Sender: kvm-owner@vger.kernel.org List-ID: 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