From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjnFt-0003K6-Cx for qemu-devel@nongnu.org; Mon, 12 May 2014 06:14:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjnFl-00066K-3q for qemu-devel@nongnu.org; Mon, 12 May 2014 06:14:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49526) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjnFk-00066C-SF for qemu-devel@nongnu.org; Mon, 12 May 2014 06:14:37 -0400 Message-ID: <53709F01.8090204@redhat.com> Date: Mon, 12 May 2014 12:14:25 +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> <53709B0C.4030808@redhat.com> <20140512100814.GA15514@redhat.com> In-Reply-To: <20140512100814.GA15514@redhat.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: "Michael S. Tsirkin" Cc: "Huangweidong (C)" , "gleb@redhat.com" , "qemu-devel@nongnu.org" , "Gonglei (Arei)" , "avi.kivity@gmail.com" , "Herongguang (Stephen)" Il 12/05/2014 12:08, Michael S. Tsirkin ha scritto: > On Mon, May 12, 2014 at 11:57:32AM +0200, Paolo Bonzini wrote: >> 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? > > I suspect interrupts can get lost then: e.g. if address didn't match any > cpus, now it matches some. No? Can you explain the problem more verbosely? :) Multiple writers would still be protected by the mutex, so you cannot have an "in-place update" writer racing with a "copy the array" writer. Paolo