From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2JyU-0001iu-8L for qemu-devel@nongnu.org; Thu, 25 Jul 2013 07:44:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2JyS-00015l-Tk for qemu-devel@nongnu.org; Thu, 25 Jul 2013 07:44:50 -0400 Received: from mail-ea0-x22a.google.com ([2a00:1450:4013:c01::22a]:57367) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2JyS-000140-KP for qemu-devel@nongnu.org; Thu, 25 Jul 2013 07:44:48 -0400 Received: by mail-ea0-f170.google.com with SMTP id h10so866105eaj.15 for ; Thu, 25 Jul 2013 04:44:47 -0700 (PDT) Date: Thu, 25 Jul 2013 13:44:44 +0200 From: Stefan Hajnoczi Message-ID: <20130725114444.GH21033@stefanha-thinkpad.redhat.com> References: <1374396185-10870-1-git-send-email-pingfank@linux.vnet.ibm.com> <429B80A9A0DBF7FBF05E7C5A@nimrod.local> <51ECD0FF.3020808@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [RFC 0/8] arm AioContext with its own timer stuff List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: liu ping fan Cc: Kevin Wolf , Alex Bligh , Jan Kiszka , Stefan Hajnoczi , qemu-devel@nongnu.org, Anthony Liguori , Paolo Bonzini On Tue, Jul 23, 2013 at 10:51:06AM +0800, liu ping fan wrote: > On Mon, Jul 22, 2013 at 2:28 PM, Jan Kiszka wrote: > > On 2013-07-22 06:38, liu ping fan wrote: > >> On Sun, Jul 21, 2013 at 5:53 PM, Alex Bligh wrote: > >>> Liu, > >>> > >>> > >>> --On 21 July 2013 16:42:57 +0800 Liu Ping Fan wrote: > >>> > >>>> Currently, the timers run on iothread within BQL, so virtio-block > >>>> dataplane can not use throttle, as Stefan Hajnoczi pointed out in his > >>>> patches to port dataplane onto block layer.(Thanks, Stefan) To enable > >>>> this feature, I plan to enable timers to run on AioContext's thread. And > >>>> maybe in future, hpet can run with its dedicated thread too. > >>>> > >>>> Also, I see Alex Bligh is on the same effort by another method,(it is a > >>>> good idea) "[RFC] aio/async: Add timed bottom-halves". > >>> > >>> > >>> Stefan & Paolo did not like that method much, so I did a third method > >>> (posted yesterday) suggested by Stefan which adds a clock to AioContext (to > >>> which timers can be attached), deletes ALL the alarm_timer stuff (which was > >>> very cathartic), uses timeouts on the g_poll, and adds ppoll where this is > >>> available. Series at: > >>> http://lists.nongnu.org/archive/html/qemu-devel/2013-07/msg03334.html > >>> > >>> I suspect this also overlaps with your code. > >>> > >>> So now we have 3 methods to do similar things! > >>> > >>> One advantage of my approach is that it removes more code than it adds > >>> (by quite a margin). However, alarm timers could have been left in. > >>> What's the advantage in giving an AioContext its own alarm timer as > >>> opposed to just its own clock? > >>> > >> I read your second series, and try to summary the main different between us. > >> Please correct me, if I misunderstood something. > >> --1st. You try to create a separate QemuClock for AioContext. > >> I think QemuClock is the clock event source and we have three > >> classic with fine definition. They should be qemu-wide for time > >> measurement. On the other handler, timer is a concept for timeout, > > > > Timers, as used in QEMU, are not only for "unimportant" and > > unlikely-to-fire timeouts. They are also for potential high-rate, high > > Sorry, but can not catch the point. QemuTimer is used to trigger > something, so the process can be delayed for some reason. For high > resolution events, do we go directly to QEMUClock, which fall back on > host's hpet? And the use case is just for get the time stamp, NOT for > trigger? It's also unclear to me what you mean, Jan. Which approach exactly are you unhappy with? We always invoke timer callbacks from the main loop, there is no high-frequency high-priority timer code path, so I'm not sure what the issue is. Stefan