From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5fj6-0004vj-3R for Qemu-devel@nongnu.org; Mon, 19 Sep 2011 11:25:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5fj4-0004C1-Tx for Qemu-devel@nongnu.org; Mon, 19 Sep 2011 11:25:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19213) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5fj4-0004Bd-N7 for Qemu-devel@nongnu.org; Mon, 19 Sep 2011 11:25:42 -0400 Message-ID: <4E775EF2.6090504@redhat.com> Date: Mon, 19 Sep 2011 17:25:38 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1316443033-6489-1-git-send-email-freddy77@gmail.com> <4E775999.7060008@redhat.com> <4E775BBA.3040904@redhat.com> In-Reply-To: <4E775BBA.3040904@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] block: avoid SIGUSR2 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: aliguori@us.ibm.com, Frediano Ziglio , Qemu-devel@nongnu.org On 09/19/2011 05:11 PM, Kevin Wolf wrote: >> > I think it is possible to go a step further, turn >> > posix_aio_process_queue into a bottom half and get rid of the pipe >> > altogether. This in turn would remove the only real user of >> > io_process_queue in qemu_aio_set_fd_handler. However, this is already a >> > nice improvement. > But without the fd, wouldn't the I/O thread possibly wait for much > longer until its select() times out and it starts processing BHs? Hmm, in qemu_aio_wait yes... In the normal qemu event loop, however, bottom halves exit the select loop with qemu_notify_event(). qemu currently has a 1-second timeout for the select, but it should work just as well with an infinite timeout. If it doesn't, it's a bug. It should be possible to turn posix_aio_process_queue into a bottom half, but the pipe is still necessary in order to exit the qemu_aio_wait select loop and schedule the bottom half. Paolo