[Spice-devel] [PATCH spice-server 13/13] red-channel-client: Add some comment on the flush code

Victor Toso victortoso at redhat.com
Fri Aug 2 10:21:20 UTC 2019


Hi,

On Thu, May 30, 2019 at 03:22:54PM +0100, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/red-channel-client.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/server/red-channel-client.c b/server/red-channel-client.c
> index 3fd51d78b..337733d5d 100644
> --- a/server/red-channel-client.c
> +++ b/server/red-channel-client.c
> @@ -1319,6 +1319,9 @@ void red_channel_client_push(RedChannelClient *rcc)
>      /* prepare_pipe_add() will reenable WRITE events when the rcc->priv->pipe is empty
>       * red_channel_client_ack_zero_messages_window() will reenable WRITE events
>       * if we were waiting for acks to be received
> +     * If we don't remove WRITE if we are waiting for ack we will be keep
> +     * notified that we can write and we then exit (see pipe_item_get) as we
> +     * are waiting for the ack consuming CPU in a tight loop
>       */
>      if ((red_channel_client_no_item_being_sent(rcc) && g_queue_is_empty(&rcc->priv->pipe)) ||
>          red_channel_client_waiting_for_ack(rcc)) {
> @@ -1326,6 +1329,9 @@ void red_channel_client_push(RedChannelClient *rcc)
>          /* channel has no pending data to send so now we can flush data in
>           * order to avoid data stall into buffers in case of manual
>           * flushing
> +         * We need to flush also in case of ack as it is possible
> +         * that for a long train of small messages the message that would
> +         * cause the client to send the ack is still in the queue

Acked-by: Victor Toso <victortoso at redhat.com>,
let me know if something is missing in this series

>           */
>          red_stream_flush(rcc->priv->stream);
>      }
> -- 
> 2.20.1
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20190802/ccd3643f/attachment-0001.sig>


More information about the Spice-devel mailing list