From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39628 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8pmO-0000wz-QV for qemu-devel@nongnu.org; Thu, 21 Oct 2010 03:41:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8pmN-00044J-EN for qemu-devel@nongnu.org; Thu, 21 Oct 2010 03:41:40 -0400 Received: from mail-fx0-f45.google.com ([209.85.161.45]:48200) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8pmN-00044C-62 for qemu-devel@nongnu.org; Thu, 21 Oct 2010 03:41:39 -0400 Received: by fxm9 with SMTP id 9so3727617fxm.4 for ; Thu, 21 Oct 2010 00:41:38 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4CBFEEAF.3070003@redhat.com> Date: Thu, 21 Oct 2010 09:41:35 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <10ae5833ff9de153c311917d532f3e84e5b00387.1287596626.git.mtosatti@redhat.com> <4CBF485C.9060808@linux.vnet.ibm.com> <4CBF65A7.3090903@redhat.com> <4CBF6747.3020308@linux.vnet.ibm.com> In-Reply-To: <4CBF6747.3020308@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 08/10] MCE: Relay UCR MCE to guest List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org, Avi Kivity On 10/21/2010 12:03 AM, Anthony Liguori wrote: >> >> The timeout of qemu_kvm_eat_signal is always zero. > > So then qemu_kvm_eat_signal purely polls and it will happily keep > polling as long as there is a signal pending. > > So what's the point of doing a sigtimedwait() and dropping qemu_mutex? I agree that keeping the qemu_mutex makes sense if you remove the timeout argument (which I even have a patch for, as part of my Win32 iothread series). Until there is the theoretical possibility of suspending the process, qemu_kvm_eat_signal should drop the mutex. > Why not just check sigpending in a loop? Because sigtimedwait eats the signal, unlike sigpending (and sigsuspend).