Received: from eggs.gnu.org ([208.118.235.92]:43740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2lav-0000hr-7K for qemu-devel@nongnu.org; Wed, 29 Feb 2012 10:37:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S2laq-00007h-6d for qemu-devel@nongnu.org; Wed, 29 Feb 2012 10:37:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2lap-00007R-U8 for qemu-devel@nongnu.org; Wed, 29 Feb 2012 10:37:28 -0500 Date: Wed, 29 Feb 2012 17:37:15 +0200 From: Alon Levy Message-ID: <20120229153715.GK15718@garlic.tlv.redhat.com> References: <1330118525-14522-1-git-send-email-alevy@redhat.com> <1330118525-14522-4-git-send-email-alevy@redhat.com> <4F4811CF.7050909@codemonkey.ws> <20120225084607.GA22687@garlic.redhat.com> <20120228171039.36c394a3@doriath.home> <20120229081553.GD8200@garlic> <20120229115837.29e6d1bf@doriath.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120229115837.29e6d1bf@doriath.home> Subject: Re: [Qemu-devel] [PATCH 4/4] add qmp screendump-async List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: qemu-devel@nongnu.org, Marc-Andre Lureau , armbru@redhat.com, Anthony Liguori , kraxel@redhat.com On Wed, Feb 29, 2012 at 11:58:37AM -0300, Luiz Capitulino wrote: > On Wed, 29 Feb 2012 10:15:53 +0200 > Alon Levy wrote: > > > On Tue, Feb 28, 2012 at 05:10:39PM -0300, Luiz Capitulino wrote: > > > On Sat, 25 Feb 2012 10:46:07 +0200 > > > Alon Levy wrote: > > > > > > > On Fri, Feb 24, 2012 at 04:40:15PM -0600, Anthony Liguori wrote: > > > > > On 02/24/2012 03:22 PM, Alon Levy wrote: > > > > > >This is an across the board change since I wanted to keep the existing > > > > > >(good imo) single graphic_console_init callback setter, instead of > > > > > >introducing a new cb that isn't set by it but instead by a second > > > > > >initialization function. > > > > > > > > > > > >Signed-off-by: Alon Levy > > > > > > > > > > What's the rationale for this? > > > > > > > > There is a hang possible with the current screendump command, qxl, a > > > > spice client using libvirt and spice-gtk such as virt-viewer / > > > > remote-viewer, where you have: > > > > 1. libvirt waiting for screendump to complete > > > > 2. screendump waiting for spice server thread to render > > > > 3. spice server thread waiting for spice client to read messages > > > > > > Which messages? > > > > spice display channel messages. > > > > > > > > > 4. spice client == libvirt client, waiting for screendump completion > > > > > > The way I had understood this problem is that qxl takes a long time to > > > perform a screen dump, which would cause the global mutex to be held for > > > a long time. If this is really serious, then a async command for it > > > makes sense IMO. > > > > That is true, but it is not the immediate problem the bz is dealing with > > - if it was only this there would be no hang. > > Well, this kind of hang always smells like a spice threading synchronization > problem to me. I thought that I'd be capable of showing that if I really > understood what was going on, but I can't, even with your diagram. It isn't a spice threading synchronization problem, it's much simpler then that: spice server flushes messages to the spice client, so the client not handling them causes it to sleep for a very long time (the timeout is 150 seconds) server: handle_dev_update/flush_display_commands The client in this case is not reading from the socket. I couldn't reproduce, but I imagined it was simply waiting for completion of the screendump command before it came around to reading the spice sockets. > > An asynchronous command solves the global mutex contention problem, but I > think this hang should be further investigated, otherwise the async command > risks just hiding the real problem.