Re: [PATCH v2] replay: do not wake up loop too much

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

 



On Tue, 2016-01-26 at 10:57 +0000, Frediano Ziglio wrote:
> Send wakeups only when a command is available.
> This emulate better what a guest driver should do (append the command
> to the ring and then signal).
> 
> Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
Acked-by: Pavel Grunt <pgrunt@xxxxxxxxxx>
> ---
>  server/tests/replay.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> Changes from v2:
> - use only one type of boolean.
> 
> diff --git a/server/tests/replay.c b/server/tests/replay.c
> index 0c98168..c7f3f00 100644
> --- a/server/tests/replay.c
> +++ b/server/tests/replay.c
> @@ -108,6 +108,7 @@ static void get_init_info(QXLInstance *qin,
> QXLDevInitInfo *info)
>  static gboolean fill_queue_idle(gpointer user_data)
>  {
>      gboolean keep = FALSE;
> +    gboolean wakeup = FALSE;
>  
>      while (g_async_queue_length(aqueue) < 50) {
>          QXLCommandExt *cmd = spice_replay_next_cmd(replay,
> qxl_worker);
> @@ -119,6 +120,7 @@ static gboolean fill_queue_idle(gpointer
> user_data)
>          if (slow)
>              g_usleep(slow);
>  
> +        wakeup = TRUE;
>          g_async_queue_push(aqueue, cmd);
>      }
>  
> @@ -132,7 +134,8 @@ end:
>          }
>          pthread_mutex_unlock(&mutex);
>      }
> -    spice_qxl_wakeup(&display_sin);
> +    if (wakeup)
> +        spice_qxl_wakeup(&display_sin);
>  
>      return keep;
>  }
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]