From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7ntU-0006Dn-VF for qemu-devel@nongnu.org; Fri, 09 Aug 2013 10:42:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V7ntO-0002q8-W8 for qemu-devel@nongnu.org; Fri, 09 Aug 2013 10:42:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2303) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7ntO-0002q3-P4 for qemu-devel@nongnu.org; Fri, 09 Aug 2013 10:42:14 -0400 Message-ID: <5204FF9D.4010401@redhat.com> Date: Fri, 09 Aug 2013 16:41:33 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1375998147-24292-1-git-send-email-alex@alex.org.uk> <1375998147-24292-13-git-send-email-alex@alex.org.uk> <5204BEC6.4090303@redhat.com> <906000ED-E6F8-488A-9214-74C1299D04A4@alex.org.uk> In-Reply-To: <906000ED-E6F8-488A-9214-74C1299D04A4@alex.org.uk> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] [PATCHv8 12/30] aio / timers: aio_ctx_prepare sets timeout from AioContext timers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Bligh Cc: Kevin Wolf , Anthony Liguori , liu ping fan , qemu-devel@nongnu.org, Stefan Hajnoczi , MORITA Kazutaka , rth@twiddle.net Il 09/08/2013 16:30, Alex Bligh ha scritto: > > On 9 Aug 2013, at 11:04, Paolo Bonzini wrote: > >>> @@ -180,7 +189,7 @@ aio_ctx_check(GSource *source) >>> return true; >>> } >>> } >>> - return aio_pending(ctx); >>> + return aio_pending(ctx) || (timerlistgroup_deadline_ns(ctx->tlg) == 0); >> >> Again, if we do the "two AioContext" tricks, the >> timerlistgroup_deadline_ns function would be internal to AioContext. > > I don't think that's true as I think we'd still want to encapsulate > walking the array of clocks within qemu-timer.c. It would just be these five lines of code, no? for (type = 0; type < QEMU_CLOCK_MAX; type++) { if (qemu_clock_use_for_deadline(qemu_clock_ptr(type))) { deadline = qemu_soonest_timeout(deadline, timerlist_deadline_ns(ctx->timerlist[type])); } } I'm not sure if it is a worthwhile to keep 80 lines of code just to abstract a single loop. Paolo