Received: from eggs.gnu.org ([2001:4830:134:3::10]:56783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOSz9-0001yd-Nb for qemu-devel@nongnu.org; Tue, 24 Sep 2013 09:49:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOSz1-0000UV-6e for qemu-devel@nongnu.org; Tue, 24 Sep 2013 09:49:03 -0400 Received: from mail-ea0-x235.google.com ([2a00:1450:4013:c01::235]:37236) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOSz1-0000UI-0M for qemu-devel@nongnu.org; Tue, 24 Sep 2013 09:48:55 -0400 Received: by mail-ea0-f181.google.com with SMTP id d10so2482136eaj.40 for ; Tue, 24 Sep 2013 06:48:54 -0700 (PDT) Date: Tue, 24 Sep 2013 15:48:51 +0200 From: Stefan Hajnoczi Message-ID: <20130924134851.GB13194@stefanha-thinkpad.redhat.com> References: <520A3888.9020307@siemens.com> <20130813142204.GA3008@stefanha-thinkpad.redhat.com> <52387EC2.6000502@siemens.com> <5238810E.1050304@redhat.com> <5238883A.90607@siemens.com> <52388BAA.1060207@redhat.com> <6BF1E4A0-946C-402A-9225-0B1DE04DBC54@alex.org.uk> <52395CD5.7030203@redhat.com> <6DF6BCC2-14BC-4B10-B22E-887D2AFF2012@alex.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6DF6BCC2-14BC-4B10-B22E-887D2AFF2012@alex.org.uk> Subject: Re: [Qemu-devel] [RFC] [PATCHv10 00/31] aio / timers: Add AioContext timers and use ppoll List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Bligh Cc: Kevin Wolf , Anthony Liguori , Jan Kiszka , qemu-devel@nongnu.org, liu ping fan , Stefan Hajnoczi , Paolo Bonzini , MORITA Kazutaka , rth@twiddle.net On Wed, Sep 18, 2013 at 09:23:09AM +0100, Alex Bligh wrote: > Paolo, > > On 18 Sep 2013, at 08:57, Paolo Bonzini wrote: > > > Il 17/09/2013 19:32, Alex Bligh ha scritto: > >> > >> On 17 Sep 2013, at 18:04, Paolo Bonzini wrote: > >> > >>> Alex, what's missing before block.c and QED can use aio_timer_new on > >>> the main AioContext, instead of timer_new? > >> > >> If we assume at this stage the threading is no different, very little > >> I think. Off the top of my head it should be a case of: > >> > >> 1. Audit timer routines to ensure they are safe to call from > >> inside aio_poll rather than mainloop. EG if there is a timer > >> routine that itself calls aio_poll, that would presumably > >> be bad. A quick check suggests we need to think about the > >> coroutine stuff carefully here if we don't want recursion. > >> > >> 2. Replace timer_new by aio_timer_new > >> > >> 3. Cross fingers and hope for the best. > > > > Yes, that was my understanding too. Can we do it for 1.7? > > Don't see why not. I'd need to immerse myself in coroutines > and understand how they all work and am off on vacation for > a week tomorrow, so someone else (Stefan?) may be able to > do it faster than me. I expect it's just a case of saying > "yup, that will work" for someone who knows the co-routine > call-graph. If not, I'll have a look at it on my return. Sorry I wasn't following this thread. But I will put together patches to convert existing block layer timers to use AioContext timers and finally let drain work without spinning. Stefan