From: Zhigang Wang Subject: Re: [PATCH]fix hang on migration Date: Wed, 29 Jul 2009 15:50:45 +0800 Message-ID: <4A6FFF55.6090301@oracle.com> References: <4A6D7AF2.20800@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4A6D7AF2.20800@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: "Kurt C. Hackel" , xen-devel , Ian Jackson , xiaowei.hu@oracle.com List-Id: xen-devel@lists.xenproject.org Hi Keir, The hang happens often when you runs many VM simultaneously. So I'd like this patch go to 3.4-testing as well. This is the regenerated patch against xen-3.4-testing. Signed-off-by: Zhigang Wang Reviewed-by: Xiaowei Hu thanks, zhigang Zhigang Wang wrote: > hi, > > the migration process may be hang when you start another VM while the migration is under way. > > Eg. > > Start a VM: > > # xm create OVM_EL5U3_X86_PVHVM_4GB/vm.cfg > > Wait for the VM bootup, then start another VM while this VM is migration: > > # xm migrate -l OVM_EL5U3_X86_PVHVM_4GB localhost & > # xm create OVM_EL5U1_X86_HVM_4GB/vm.cfg > > The migration will hang on: > > # xm list > Name ID Mem VCPUs State Time(s) > Domain-0 0 543 2 r----- 110.1 > OVM_EL5U1_X86_HVM_4GB 4 256 1 -b---- 39.6 > OVM_EL5U3_X86_PVHVM_4GB 5 512 1 --p--- 0.0 > > The migration will only finish after shutting down VM OVM_EL5U1_X86_HVM_4GB. > > This is because we are using a threaded model in xend, and the migration thread is running > in the same context, and we are using pipes/sockets in migration. > > So the write side of the pipe/socket created while migration will inherited to children, thus > the reading side of the pipe/socket will hang if there is a child forked and the child never end up > (like qemu-dm). > > So we should close all inherited open file descriptors in every forked process. > > Ian: please review the patch against qemu-dm forking. > > Signed-off-by: Zhigang Wang > Reviewed-by: Xiaowei Hu > > thanks, > > zhigang > > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel