From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDBJ8-0002lX-IT for qemu-devel@nongnu.org; Thu, 09 Jul 2015 08:52:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDBJ4-0000ab-6R for qemu-devel@nongnu.org; Thu, 09 Jul 2015 08:52:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41647) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDBJ4-0000Zp-1T for qemu-devel@nongnu.org; Thu, 09 Jul 2015 08:52:02 -0400 References: <1436274549-28826-1-git-send-email-quintela@redhat.com> <1436274549-28826-28-git-send-email-quintela@redhat.com> <20150708191318.GM4117@noname.redhat.com> <559D89AD.4090000@redhat.com> <559DCC2A.1040400@cn.fujitsu.com> <559E29E5.5000402@redhat.com> <559E2D57.4020204@cn.fujitsu.com> From: Paolo Bonzini Message-ID: <559E6E6C.5010507@redhat.com> Date: Thu, 9 Jul 2015 14:51:56 +0200 MIME-Version: 1.0 In-Reply-To: <559E2D57.4020204@cn.fujitsu.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 27/28] migration: protect migration_bitmap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wen Congyang , Kevin Wolf , Juan Quintela Cc: amit.shah@redhat.com, qemu-devel@nongnu.org, Li Zhijian On 09/07/2015 10:14, Wen Congyang wrote: > > flush_compressed_data(f); > > ram_control_after_iterate(f, RAM_CONTROL_FINISH); > > - migration_end(); > > - > > rcu_read_unlock(); > > + > > + migration_end(); > > qemu_put_be64(f, RAM_SAVE_FLAG_EOS); > > Yes, this patch can work. But if the caller hold the rcu read lock in > the future, we may need to fix it again. I think it is better to use > call_rcu(). Why? Just document that migration_end must be called outside an RCU read-side critical section. It's not a heavy limitation. Paolo