From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JnyBb-0006UQ-Bz for qemu-devel@nongnu.org; Mon, 21 Apr 2008 11:44:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JnyBX-0006Tp-Pd for qemu-devel@nongnu.org; Mon, 21 Apr 2008 11:44:07 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JnyBX-0006Tk-I0 for qemu-devel@nongnu.org; Mon, 21 Apr 2008 11:44:03 -0400 Received: from rn-out-0910.google.com ([64.233.170.186]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JnyBW-0001uV-Lc for qemu-devel@nongnu.org; Mon, 21 Apr 2008 11:44:03 -0400 Received: by rn-out-0910.google.com with SMTP id e24so395797rng.8 for ; Mon, 21 Apr 2008 08:43:45 -0700 (PDT) Message-ID: <480CB61D.8050507@codemonkey.ws> Date: Mon, 21 Apr 2008 10:43:25 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Linux SIGIO handling changes References: <12086832292508-git-send-email-mail@flac.kalibalik.dk> <480BBDE9.5040209@codemonkey.ws> <480C98B3.7050905@qumranet.com> In-Reply-To: <480C98B3.7050905@qumranet.com> Content-Type: text/plain; charset=ISO-8859-1; 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 Avi Kivity wrote: > Anthony Liguori wrote: >> Anders Melchiorsen wrote: >>> I am resending this patch, split into two parts now. >>> >>> This cleans up SIGIO handling to improve latency: >>> - SIGALRM for alarm timers >>> - enable SIGIO on qemu_set_fd_handler2() >>> >>> The issue was found in KVM, where it is much more visible, >>> because there is no periodic timer. However, it has been >>> confirmed (by Aurelien Jarno) that even for qemu, this >>> approach "improves network transfers in a huge way". >>> >>> Please apply, or give a firm rejection so I can stop resending. >>> >> >> Probably the right thing to do is the direction KVM is moving toward, >> i.e. have a separate IO thread. >> >> Setting SIGIO on every file descriptor is really just a hack to break >> out of the cpu exec loop. It's unclear to me whether it's really >> always the right thing to do for every file descriptor. >> > > Even with a separate iothread one needs the signals, as there is no > other race-free way to poll for both aio completions and fd readiness. Unless you emulate signalfd() using a thread. FWIW, I've been thinking of implementing something similar to posix-aio (using a thread-pool for AIO) for QEMU to get a bit more control for this sort of thing. posix-aio is a pretty unfortunate interface as it doesn't provide a mechanism to do asynchronous fdatasync() nor individual vector requests. Regards, Anthony Liguori Regards, Anthony Liguori > [well, pselect works, but I dislike it and it isn't present on all > kernels] >