From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH 03/21] Remove use of signalfd in block-raw-posix.c Date: Thu, 30 Apr 2009 07:54:34 -0500 Message-ID: <49F99F8A.8010806@codemonkey.ws> 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> 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: Avi Kivity Return-path: Received: from qw-out-2122.google.com ([74.125.92.24]:25342 "EHLO qw-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752499AbZD3Myi (ORCPT ); Thu, 30 Apr 2009 08:54:38 -0400 Received: by qw-out-2122.google.com with SMTP id 5so1521344qwd.37 for ; Thu, 30 Apr 2009 05:54:38 -0700 (PDT) In-Reply-To: <49F96F37.2070002@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. >> It's not necessarily a bad thing to use signalfd, but this is >> something that >> should be done upstream. It certainly does qemu-kvm no harm to use >> the upstream >> code. >> > > It will introduce a (likely minor, but real) performance regression. > > Instead of this, why not apply the reverse patch to qemu.git? 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. Regards, Anthony Liguori