From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSj0p-0004pq-Oo for qemu-devel@nongnu.org; Wed, 26 Mar 2014 04:16:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSj0i-0006Jr-PR for qemu-devel@nongnu.org; Wed, 26 Mar 2014 04:16:39 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:41838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSj0i-0006Ir-E6 for qemu-devel@nongnu.org; Wed, 26 Mar 2014 04:16:32 -0400 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 26 Mar 2014 08:16:30 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id C21EC17D8063 for ; Wed, 26 Mar 2014 08:17:14 +0000 (GMT) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s2Q8GHgH63766672 for ; Wed, 26 Mar 2014 08:16:17 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s2Q8GS3x028027 for ; Wed, 26 Mar 2014 02:16:28 -0600 Message-ID: <53328CDB.4050702@de.ibm.com> Date: Wed, 26 Mar 2014 09:16:27 +0100 From: Christian Borntraeger MIME-Version: 1.0 References: <33183CC9F5247A488A2544077AF19020815DA9BD@SZXEMA503-MBS.china.huawei.com> <53317892.2050506@redhat.com> In-Reply-To: <53317892.2050506@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 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: Paolo Bonzini , "Gonglei (Arei)" , "qemu-devel@nongnu.org" , "kvm@vger.kernel.org" Cc: "Herongguang (Stephen)" , "Huangweidong (C)" , "avi.kivity@gmail.com" , "gleb@redhat.com" , "mst@redhat.com" On 25/03/14 13:37, Paolo Bonzini wrote: > Il 25/03/2014 04:19, Gonglei (Arei) ha scritto: >> Based on discussions in: >> http://lists.gnu.org/archive/html/qemu-devel/2013-11/threads.html#03322 >> >> About KVM_SET_GSI_ROUTING ioctl, I tested changing RCU to SRCU, but unfortunately >> it looks like SRCU's grace period is no better than RCU. > > Really? This is not what Christian Borntraeger claimed at http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/118083 -- in fact, Andrew Theurer is currently testing a variant of that patch and I was going to post it for 3.16. > > Have you tried synchronize_srcu_expedited? Unlike the RCU variant, you can use this function. On my system I have HZ=100 and lots of CPUs. So RCUs "every cpu has scheduled" is certainly slower than SRCUs algorithm (/* * We use an adaptive strategy for synchronize_srcu() and especially for * synchronize_srcu_expedited(). We spin for a fixed time period * (defined below) to allow SRCU readers to exit their read-side critical * sections. If there are still some readers after 10 microseconds, * we repeatedly block for 1-millisecond time periods. This approach * has done well in testing, so there is no need for a config parameter. */ ) With HZ==1000 and a NO. CPUs small SRCUs spinning might be in the same delay range than classic RCU depending on how long the read side critical section is (if we move from spinning to blocking) So using synchronize_srcu_expedited is certainly something to test as it increased the spinning time. Christian