From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2I0l-0000nv-Ui for qemu-devel@nongnu.org; Thu, 25 Jul 2013 05:39:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2I0k-0005aN-Oj for qemu-devel@nongnu.org; Thu, 25 Jul 2013 05:39:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2I0j-0005aD-I8 for qemu-devel@nongnu.org; Thu, 25 Jul 2013 05:39:02 -0400 Message-ID: <51F0F21B.7090409@redhat.com> Date: Thu, 25 Jul 2013 11:38:35 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1E8E204.8000201@redhat.com> <1374343603-29183-1-git-send-email-alex@alex.org.uk> <1374343603-29183-2-git-send-email-alex@alex.org.uk> <20130725091015.GC21033@stefanha-thinkpad.redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv2] [RFC 1/7] aio / timers: Remove alarm timers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Bligh Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi , qemu-devel@nongnu.org, Stefan Hajnoczi , rth@twiddle.net Il 25/07/2013 11:37, Alex Bligh ha scritto: > Stefan, > >> This should be one of the last patches so qemu.git remains bisectable. >> Only remove the alarm timer once the event loops are already using the >> timeout argument. > > OK > >>> @@ -245,11 +82,7 @@ static QEMUClock *qemu_new_clock(int type) >>> >>> void qemu_clock_enable(QEMUClock *clock, bool enabled) >>> { >>> - bool old = clock->enabled; >>> clock->enabled = enabled; >>> - if (enabled && !old) { >>> - qemu_rearm_alarm_timer(alarm_timer); >>> - } >> >> If this function is supposed to work when called from another thread >> (e.g. vcpu thread), then you need to call qemu_notify_event(). For >> AioContext clocks that should be aio_notify() with the relevant >> AioContext, but we don't need that yet. > > Each AioContext knows which clock it has but each clock doesn't know if > it's part of an AioContext. I suggest this is infrequent enough that always > using qemu_notify_event() would be OK. That should interrupt any poll. No, qemu_notify_event() only interrupts the main clock's poll. Paolo