From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [Qemu-devel] [RFC] create a single workqueue for each vm to update vm irq routing table Date: Thu, 28 Nov 2013 09:55:42 +0100 Message-ID: <5297050E.6000700@redhat.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , Avi Kivity , Avi Kivity , "Huangweidong (C)" , KVM , "Michael S. Tsirkin" , "Jinxin (F)" , Luonengjun , "qemu-devel@nongnu.org" , Zanghongyong To: "Zhanghaoyu (A)" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:47354 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750884Ab3K1Izz (ORCPT ); Thu, 28 Nov 2013 03:55:55 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: 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