From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTy7L-0002Em-SS for qemu-devel@nongnu.org; Wed, 09 Oct 2013 14:04:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VTy7A-0000H9-8s for qemu-devel@nongnu.org; Wed, 09 Oct 2013 14:04:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4551) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTy7A-0000Gr-0V for qemu-devel@nongnu.org; Wed, 09 Oct 2013 14:04:04 -0400 Message-ID: <52559A8A.2070201@redhat.com> Date: Wed, 09 Oct 2013 20:03:54 +0200 From: Hans de Goede MIME-Version: 1.0 References: <1381259403-7386-1-git-send-email-hdegoede@redhat.com> <52545950.5070403@redhat.com> <52545B44.70005@redhat.com> <28EE4224-856B-4DC1-8159-A0C274BD269E@alex.org.uk> <52546000.6070308@redhat.com> <6CD4D4EE-341E-48D0-98F4-D55C0D3922D4@alex.org.uk> <52546832.9040900@redhat.com> <5254701B.5070804@redhat.com> <525552D9.90407@redhat.com> <2451DF8D-DD3E-4875-B6D6-CEF66A763D7E@alex.org.uk> In-Reply-To: <2451DF8D-DD3E-4875-B6D6-CEF66A763D7E@alex.org.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] main-loop: Don't lock starve io-threads when main_loop_tlg has pending events List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Bligh Cc: Paolo Bonzini , qemu-devel@nongnu.org Hi, On 10/09/2013 03:18 PM, Alex Bligh wrote: >> qemu_mod_timer(timer->timer, qemu_get_clock_ms(rt_clock) + ms); > > qemu_mod_timer does not exist in master. > > This line is now: > > timer_mod(timer->timer, qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + ms); Ah yes my bad, I was accidentally looking at a stable-1.5 checkout. > This suggests to me either timer->scale is not set to 1000000 (i.e. > it isn't in milliseconds), The timer always gets created like this: timer->timer = timer_new_ms(QEMU_CLOCK_REALTIME, func, opaque); > OR ms is zero/negative. Nope I've added a debug printf to the spice timer code and it all works as expected. So I started looking for suspecious timers under audio/*.c and immediately found this in audio/audio.c : static void audio_reset_timer (AudioState *s) { if (audio_is_timer_needed ()) { timer_mod (s->ts, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + 1); } else { timer_del (s->ts); } } static void audio_timer (void *opaque) { audio_run ("timer"); audio_reset_timer (opaque); } Note how that is using a timer which expires every freaking nano second, I think it is very likely that is the culprit. Regards, Hans