From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 08/10] MCE: Relay UCR MCE to guest Date: Thu, 21 Oct 2010 09:41:35 +0200 Message-ID: <4CBFEEAF.3070003@redhat.com> References: <10ae5833ff9de153c311917d532f3e84e5b00387.1287596626.git.mtosatti@redhat.com> <4CBF485C.9060808@linux.vnet.ibm.com> <4CBF65A7.3090903@redhat.com> <4CBF6747.3020308@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org, Avi Kivity To: Anthony Liguori Return-path: Received: from mail-fx0-f46.google.com ([209.85.161.46]:51586 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751911Ab0JUHli (ORCPT ); Thu, 21 Oct 2010 03:41:38 -0400 Received: by mail-fx0-f46.google.com with SMTP id 4so3471650fxm.19 for ; Thu, 21 Oct 2010 00:41:38 -0700 (PDT) In-Reply-To: <4CBF6747.3020308@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: 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).