qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCHv11 13/31] aio / timers: aio_ctx_prepare sets tim


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCHv11 13/31] aio / timers: aio_ctx_prepare sets timeout from AioContext timers
Date: Wed, 21 Aug 2013 11:01:42 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Aug 15, 2013 at 09:34:21PM +0100, Alex Bligh wrote:
> @@ -150,13 +150,14 @@ aio_ctx_prepare(GSource *source, gint    *timeout)
>  {
>      AioContext *ctx = (AioContext *) source;
>      QEMUBH *bh;
> +    int deadline;
>  
>      for (bh = ctx->first_bh; bh; bh = bh->next) {
>          if (!bh->deleted && bh->scheduled) {
>              if (bh->idle) {
>                  /* idle bottom halves will be polled at least
>                   * every 10ms */
> -                *timeout = 10;
> +                *timeout = qemu_soonest_timeout(*timeout, 10);
>              } else {
>                  /* non-idle bottom halves will be executed
>                   * immediately */

I agree with Wenchao:

The docs explicitly say that .prepare() can set timeout to the maximum
timeout value that is required.  It then explains that the "actual
timeout used" is the minimum of all timeout values - it's not our job to
calculate the minimum, glib will do that after calling all .prepare()
functions.

I would drop this hunk.

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]