Received: from eggs.gnu.org ([2001:4830:134:3::10]:54340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uz9oR-0003Z6-Hf for qemu-devel@nongnu.org; Tue, 16 Jul 2013 14:17:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uz9oM-000789-GF for qemu-devel@nongnu.org; Tue, 16 Jul 2013 14:17:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61048) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uz9oM-00077R-9K for qemu-devel@nongnu.org; Tue, 16 Jul 2013 14:17:18 -0400 From: Laszlo Ersek Date: Tue, 16 Jul 2013 20:19:39 +0200 Message-Id: <1373998781-29561-1-git-send-email-lersek@redhat.com> Subject: [Qemu-devel] [PATCH 0/2] changes related to monitor flow control List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori , Luiz Capitulino , qemu-devel@nongnu.org When the IO thread calls monitor_flush() repeatedly & quickly in succession, outside of callback context, many redundant G_IO_OUT watches are installed. (One such caller is the "info tlb" / tlb_info() HMP command which produces a lot of monitor output.) While this redundancy is no problem in itself, it can trigger -1/EINVAL in poll() by growing "gpollfds" beyond limits. This is a persistent condition, causing qemu to spin in the main loop. Patch #2 corrects this. My first stab at a fix was patch #1. Although in retrospect probably unrelated to the main problem, I'm including it because it should qualify as an improvement / cleanup in its own right. See for more details. Laszlo Ersek (2): char: io_channel_send: don't lose written bytes monitor: maintain at most one G_IO_OUT watch monitor.c | 11 +++++++++-- qemu-char.c | 41 +++++++++++++++++++---------------------- 2 files changed, 28 insertions(+), 24 deletions(-)