From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlxOD-0005yM-7Y for qemu-devel@nongnu.org; Thu, 28 Nov 2013 03:56:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlxO7-0006sJ-8G for qemu-devel@nongnu.org; Thu, 28 Nov 2013 03:56:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:29392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlxO6-0006sE-Uw for qemu-devel@nongnu.org; Thu, 28 Nov 2013 03:55:55 -0500 Message-ID: <5297050E.6000700@redhat.com> Date: Thu, 28 Nov 2013 09:55:42 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <52949847.6020908@redhat.com> <5294A68F.6060301@redhat.com> <5294B461.5000405@redhat.com> <5294B634.4050801@cloudius-systems.com> <20131126150357.GA20352@redhat.com> <5294BC3B.6070902@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] create a single workqueue for each vm to update vm irq routing table List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Zhanghaoyu (A)" Cc: Avi Kivity , "Huangweidong (C)" , KVM , Gleb Natapov , "Michael S. Tsirkin" , Luonengjun , "qemu-devel@nongnu.org" , Zanghongyong , Avi Kivity , "Jinxin (F)" Il 28/11/2013 07:27, Zhanghaoyu (A) ha scritto: >> >Without synchronize_rcu you could have >> > >> > VCPU writes to routing table >> > e = entry from IRQ routing table >> > kvm_irq_routing_update(kvm, new); >> > VCPU resumes execution >> > kvm_set_msi_irq(e, &irq); >> > kvm_irq_delivery_to_apic_fast(); >> > >> >where the entry is stale but the VCPU has already resumed execution. >> > > If we use call_rcu()(Not consider the problem that Gleb pointed out temporarily) instead of synchronize_rcu(), should we still ensure this? The problem is that we should ensure this, so using call_rcu is not possible (even not considering the memory allocation problem). Can you try using SRCU and synchronize_srcu? Paolo