Received: from eggs.gnu.org ([2001:4830:134:3::10]:39648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V04L0-000690-GR for qemu-devel@nongnu.org; Fri, 19 Jul 2013 02:38:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V04Kz-0001af-IN for qemu-devel@nongnu.org; Fri, 19 Jul 2013 02:38:46 -0400 Received: from mail.avalus.com ([2001:41c8:10:1dd::10]:49132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V04Kz-0001aa-C1 for qemu-devel@nongnu.org; Fri, 19 Jul 2013 02:38:45 -0400 Date: Fri, 19 Jul 2013 07:38:31 +0100 From: Alex Bligh Message-ID: <59E068CDCDE212F730299140@nimrod.local> In-Reply-To: <20130719015850.GA29671@stefanha-thinkpad.redhat.com> References: <51E4E54A.10908@redhat.com> <51E4F77C.2090509@redhat.com> <794E19D97CCC267CCBFA8397@Ximines.local> <51E56A1A.50502@redhat.com> <19631228D7B62545DC6A2928@Ximines.local> <51E57AF3.1050409@redhat.com> <20130717030230.GA27807@stefanha-thinkpad.redhat.com> <51A6D731C894ECC429EA2171@nimrod.local> <20130719015850.GA29671@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Re: [Qemu-devel] [PATCH] [RFC] aio/async: Add timed bottom-halves Reply-To: Alex Bligh List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi , qemu-devel@nongnu.org, Alex Bligh , Paolo Bonzini , rth@twiddle.net Stefan, --On 19 July 2013 09:58:50 +0800 Stefan Hajnoczi wrote: >> Options: >> >> a) restore alarm timers (at least for the time being). Make all >> alarm timers do qemu_notify_event. However, only run the AioContext >> clock's timers within aio_poll. This is the least intrusive change. >> >> b) calculate the timeout in aio_poll with respect to the minimum >> deadline across all clocks, not just AioContext's clock. Use the >> same logic in mainloop. >> >> I'd go for (b), except for the millisecond accuracy thing. So my >> temptation (sadly) is (a). > > I think this is a non-issue because host_alarm_handler() can only be > called from the main loop: > > main-loop.c:qemu_signal_init() sets up signalfd to monitor SIGALRM. > Therefore we do not asynchronously invoke the SIGALRM signals handler. > It is only invoked from main-loop.c:sigfd_handler() when the main loop > runs. > > That's how I read the code. I haven't checked a running process to be > sure. Not sure that's the case on win32, but OK let's go with that. However, I still don't quite see how the poll in the mainloop is meant to exit when a timer expires. There's now no qemu_notify_event, and no SIGALRM, and the timeout will still be infinite (unless I calculate the timeout as the minimum across all clocks, in which case I might as well do (b) above). -- Alex Bligh