From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark McLoughlin Subject: Re: Fix migration issue when the destination is loaded Date: Thu, 16 Jul 2009 10:39:39 +0100 Message-ID: <1247737179.3038.21.camel@blaa> References: <4A5DEFB3.4060702@redhat.com> Reply-To: Mark McLoughlin Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: kvm-devel To: dlaor@redhat.com Return-path: Received: from mx2.redhat.com ([66.187.237.31]:46194 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754753AbZGPJkA (ORCPT ); Thu, 16 Jul 2009 05:40:00 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6G9e06U022262 for ; Thu, 16 Jul 2009 05:40:00 -0400 In-Reply-To: <4A5DEFB3.4060702@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Hi Dor, On Wed, 2009-07-15 at 18:03 +0300, Dor Laor wrote: > If the migration socket is full, we get EAGAIN for the write. > The set_fd_handler2 defers the write for later on. The function > tries to wake up the iothread by qemu_kvm_notify_work. > Since this happens in a loop, multiple times, the pipe that emulates > eventfd becomes full and we get a deadlock. I'm not sure I follow: - You're seeing qemu_kvm_notify_work() being called many times - The call chain is migrate_fd_put_buffer(), qemu_set_fd_handler2(), main_loop_break() - This happens when write() in migrate_fd_put_buffer() returns EAGAIN because the socket buffer has filled up Correct? That sounds like migrate_fd_put_buffer() is being called repeatedly while we know the socket isn't writable? Shouldn't the buffered file could stop attempting to call put_buffer() until it has been notified that the underlying fd is writable? Cheers, Mark.