From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 03/21] Remove use of signalfd in block-raw-posix.c Date: Thu, 30 Apr 2009 16:05:00 +0300 Message-ID: <49F9A1FC.2060705@redhat.com> References: <1241040038-17183-1-git-send-email-aliguori@us.ibm.com> <1241040038-17183-4-git-send-email-aliguori@us.ibm.com> <49F96F37.2070002@redhat.com> <49F99F8A.8010806@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Anthony Liguori , kvm@vger.kernel.org To: Anthony Liguori Return-path: Received: from mx2.redhat.com ([66.187.237.31]:56760 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752486AbZD3NFM (ORCPT ); Thu, 30 Apr 2009 09:05:12 -0400 In-Reply-To: <49F99F8A.8010806@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: Anthony Liguori wrote: > Avi Kivity wrote: >> Anthony Liguori wrote: >>> We don't use signalfd in upstream QEMU. Instead, we always emulate it. >>> >> >> With an extra thread -> so an extra context switch. > > We don't use an extra thread. We just install a signal handler that > writes to a pipe. At best, the added overhead is that we get EINTRs > more often but this is something we already handle. Oh okay. But signal delivery is slow; for example the FPU needs to be reset. > I'm not sure signalfd really buys us much. To emulate it requires > writing a bunch more data to the pipe. When writing more than 1 byte, > we have to worry about whether there's a partial write because the > pipe buffers full). We also have to make sure to read from the fd in > properly sized chunks. Then we can use one byte writes (and reads) when signalfd is not available. 128 byte pipe read/writes should always be atomic on Linux though, likely on other OSes too. -- error compiling committee.c: too many arguments to function