From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjmzS-0000Ab-BB for qemu-devel@nongnu.org; Mon, 12 May 2014 05:57:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjmzN-0001Hd-Ik for qemu-devel@nongnu.org; Mon, 12 May 2014 05:57:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjmzN-0001GC-AO for qemu-devel@nongnu.org; Mon, 12 May 2014 05:57:41 -0400 Message-ID: <53709B0C.4030808@redhat.com> Date: Mon, 12 May 2014 11:57:32 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <33183CC9F5247A488A2544077AF19020815E7324@SZXEMA503-MBS.china.huawei.com> <536C8E83.8030504@redhat.com> <33183CC9F5247A488A2544077AF19020815E744C@SZXEMA503-MBS.china.huawei.com> <536CA5A5.4080303@redhat.com> <33183CC9F5247A488A2544077AF19020815E7B70@SZXEMA503-MBS.china.huawei.com> In-Reply-To: <33183CC9F5247A488A2544077AF19020815E7B70@SZXEMA503-MBS.china.huawei.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] vhost: Can we change synchronize_rcu to call_rcu in vhost_set_memory() in vhost kernel module? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gonglei (Arei)" , "qemu-devel@nongnu.org" Cc: "gleb@redhat.com" , "Huangweidong (C)" , "Herongguang (Stephen)" , "avi.kivity@gmail.com" , "mst@redhat.com" Il 12/05/2014 11:28, Gonglei (Arei) ha scritto: > From previous discussion: > https://lists.gnu.org/archive/html/qemu-devel/2014-03/msg04925.html > we know that you are going to replace RCU in KVM_SET_GSI_ROUTING with SRCU. Though > SRCU is quite better than originally RCU, in our test case this cannot satisfy our needs. Our VMs > work in telecom scenario, VMs report CPU and memory usage to balance node each second, and > balance node dispatch works to different VMs according to VM load. Since this balance needs > high accuracy, IRQ affinity settings in VM also need high accuracy, so we balance IRQ affinity in > every 0.5s. So for telecom scenario, KVM_SET_GSI_ROUTING IOCTL needs much optimization. > And in live migration case, VHOST_SET_MEM_TABLE needs attention. > > We tried to change synchronize_rcu() to call_rcu() with rate limit, but rate limit is not easy to > configure. Do you have better ideas to achieve this? Thanks. Perhaps we can check for cases where only the address is changing, and poke at an existing struct kvm_kernel_irq_routing_entry without doing any RCU synchronization? As long as kvm_set_msi_irq only reads address_lo once, it should work. VHOST_SET_MEM_TABLE is a different problem. What happens in userspace that leads to calling that ioctl? Can we remove it altogether, or delay it to after the destination has started running? Paolo