qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Alex Bligh <alex@alex.org.uk>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCH] [RFC] aio/async: Add timed bottom-halves
Date: Tue, 16 Jul 2013 18:55:15 +0200	[thread overview]
Message-ID: <51E57AF3.1050409@redhat.com> (raw)
In-Reply-To: <19631228D7B62545DC6A2928@Ximines.local>

Il 16/07/2013 18:14, Alex Bligh ha scritto:
> Paolo,
> 
>>> 3. aio_poll calls aio_bh_poll. If this returns true, this indicates
>>>   at least one non-idle bh exists, which causes aio_poll not to
>>>   block.
>>
>> No, this indicates that at least one scheduled non-idle bh exist*ed*,
>> which causes aio_poll not to block (because some progress has been done).
> 
> Ah yes, in the sense the callback will have been called and it now
> doesn't exist.

Or at least isn't scheduled.

>>> 4. aio_poll then calls g_poll (POSIX) or WaitForMultipleObjects
>>>   (Windows). However, the timeout is either 0 or infinite.
>>>   Both functions take a milliseconds (yuck) timeout, but that
>>>   is not used.
>>
>> I agree with the yuck. :)  But Linux has the nanoseconds-resolution
>> ppoll, too.
> 
> Sadly I don't think we have a g_ppoll.

Doesn't matter, poll==g_poll on POSIX systems.  You can just use poll
(or g_poll) on non-Linux, and ppoll on Linux.

>> But I wouldn't introduce a
>> new one-off concept (almost as much of a hack as idle BHs), I would
>> rather reuse as much code as possible from QEMUTimer/QEMUClock.  I must
>> admit I don't have a clear idea of how the API would look like.
> 
> So the reason I was trying to avoid using QEMUTimer stuff was that
> bh's get called from aio_poll and it was not evident that all timers
> would be safe to call from aio_poll.

It wouldn't.

> What do you think? In the end I thought the schedule_bh_at stuff
> was simpler.

It is simpler, but I'm not sure it is the right API.  Of course, if
Kevin and Stefan says it is, I have no problem with that.

Paolo

  reply	other threads:[~2013-07-16 16:55 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-06 16:24 [Qemu-devel] [PATCH] [RFC] aio/async: Add timed bottom-halves Alex Bligh
2013-07-06 16:31 ` Alex Bligh
2013-07-06 18:04   ` [Qemu-devel] [PATCHv2] " Alex Bligh
2013-07-15 14:25 ` [Qemu-devel] [PATCH] " Paolo Bonzini
2013-07-15 20:15   ` Alex Bligh
2013-07-15 20:53     ` Paolo Bonzini
2013-07-15 23:04       ` Alex Bligh
2013-07-16  6:16         ` Paolo Bonzini
2013-07-16  7:30           ` Alex Bligh
2013-07-16  7:34             ` Paolo Bonzini
2013-07-16 15:29               ` Alex Bligh
2013-07-16 15:43                 ` Paolo Bonzini
2013-07-16 16:14                   ` Alex Bligh
2013-07-16 16:55                     ` Paolo Bonzini [this message]
2013-07-16 21:22                       ` [Qemu-devel] [PATCHv3] " Alex Bligh
2013-07-16 21:24                       ` [Qemu-devel] [PATCH] " Alex Bligh
2013-07-17  3:02                         ` Stefan Hajnoczi
2013-07-17  8:07                           ` Alex Bligh
2013-07-17  8:11                             ` Paolo Bonzini
2013-07-17 16:09                               ` Alex Bligh
2013-07-18 18:48                           ` Alex Bligh
2013-07-19  1:58                             ` Stefan Hajnoczi
2013-07-19  6:22                               ` Paolo Bonzini
2013-07-19  6:38                               ` Alex Bligh
2013-07-19  6:51                                 ` Paolo Bonzini
2013-07-19 17:26                                   ` [Qemu-devel] [PATCH] [RFC] aio/timers: Drop alarm timers; introduce QEMUClock to AioContext; run timers in aio_poll Alex Bligh
2013-07-25  9:00                                     ` Stefan Hajnoczi
2013-07-25  9:02                                     ` Stefan Hajnoczi
2013-07-17  7:50                       ` [Qemu-devel] [PATCH] [RFC] aio/async: Add timed bottom-halves Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51E57AF3.1050409@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex@alex.org.uk \
    --cc=aliguori@us.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).