From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTdAW-0002Vl-Cg for qemu-devel@nongnu.org; Tue, 08 Oct 2013 15:42:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VTdAQ-0007Je-5J for qemu-devel@nongnu.org; Tue, 08 Oct 2013 15:42:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTdAP-0007JL-UX for qemu-devel@nongnu.org; Tue, 08 Oct 2013 15:42:02 -0400 Message-ID: <52546000.6070308@redhat.com> Date: Tue, 08 Oct 2013 21:41:52 +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> In-Reply-To: <28EE4224-856B-4DC1-8159-A0C274BD269E@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/08/2013 09:33 PM, Alex Bligh wrote: > > On 8 Oct 2013, at 20:21, Hans de Goede wrote: > >> Wasn't it 1 ms until the offending commit (note 250 us does >> sound better to me). > > I believe you've made it 1 nanosecond not 1 millisecond; Correct, the 1 ms I referred to was before your commit which changed things from ms to ns. > can that be right? The purpose of the 1 ns timeout is to cause os_host_main_loop_wait to unlock the iothread, as $subject says the problem I'm seeing seems to be lock starvation not cpu starvation. Note as I already indicated I'm in no way an expert in this, if you and or Paolo suspect cpu starvation may happen too, then bumping the timeout to 250 us is fine with me too. If we go with 250 us that thus pose the question though if we should always keep a minimum timeout of 250 us when not non-blocking, or only bump it to 250 us when main_loop_tlg has already expired events and thus is causing a timeout of 0. Regards, Hans