From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kxp7e-0007u3-Qp for qemu-devel@nongnu.org; Wed, 05 Nov 2008 15:37:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kxp7c-0007pu-B9 for qemu-devel@nongnu.org; Wed, 05 Nov 2008 15:37:01 -0500 Received: from [199.232.76.173] (port=57436 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kxp7c-0007pJ-4K for qemu-devel@nongnu.org; Wed, 05 Nov 2008 15:37:00 -0500 Received: from qw-out-1920.google.com ([74.125.92.145]:51357) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kxp7b-0003UO-Pc for qemu-devel@nongnu.org; Wed, 05 Nov 2008 15:36:59 -0500 Received: by qw-out-1920.google.com with SMTP id 5so166984qwc.4 for ; Wed, 05 Nov 2008 12:36:58 -0800 (PST) Message-ID: <491203E7.50607@codemonkey.ws> Date: Wed, 05 Nov 2008 14:36:55 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH] Fix alarm_timer race with select - v3 References: <4911E5AA.1000408@siemens.com> <4911EE29.7040300@siemens.com> In-Reply-To: <4911EE29.7040300@siemens.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Jan Kiszka wrote: > Changing the default IO timeout to 5 s (#5578) made a race visible > between the alarm_timer and select() in main_loop_wait(): If the timer > fired before select was able to block, the full select() timeout could > have been applied instead of returning immediately. Since #5578, this > causes heavy problems to the Musicpal board emulation with stalls up to > 5 s, but also with some older Linux guest kernels. > > The following patch introduces a pipe that is written to by > host_alarm_handler and select()'ed in main_loop_wait(). This avoids > prevents that select() blocks though a timer has fired and waits for > processing. > > Signed-off-by: Jan Kiszka > Applied. Thanks. Regards, Anthony Liguori