[Spice-devel] [PATCH 19/24] server/red_channel: red_channel_pipe_get: enforce ack window

Alon Levy alevy at redhat.com
Wed Feb 2 13:28:12 PST 2011


On Wed, Feb 02, 2011 at 07:53:28PM +0100, Marc-André Lureau wrote:
> nack, see comment in patch #22.
> 
> On Wed, Jan 19, 2011 at 7:08 PM, Alon Levy <alevy at redhat.com> wrote:
> > We were not setting blocked flag if too many messages weren't
> > acked (twice the ack window size).
> > From red_worker.
> > ---
> >  server/red_channel.c |    9 +++++----
> >  1 files changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/server/red_channel.c b/server/red_channel.c
> > index bfa6aaf..990b9d9 100644
> > --- a/server/red_channel.c
> > +++ b/server/red_channel.c
> > @@ -570,17 +570,18 @@ void red_channel_pipe_add_type(RedChannel *channel, int pipe_item_type)
> >     red_channel_push(channel);
> >  }
> >
> > -static PipeItem *red_channel_pipe_get(RedChannel *channel)
> > +static inline PipeItem *red_channel_pipe_get(RedChannel *channel)
> 
> Why do you put inline here?

Assumed but didn't test that this improves performance. (btw,
we have 140 inlines in server/red_worker.[ch])

> 
> >  {
> >     PipeItem *item;
> >
> >     if (!channel || channel->send_data.blocked ||
> > -        (channel->handle_acks &&
> > -         (channel->ack_data.messages_window > channel->ack_data.client_window * 2)) ||
> >         !(item = (PipeItem *)ring_get_tail(&channel->pipe))) {
> >         return NULL;
> >     }
> > -
> > +    if (channel->handle_acks && (channel->ack_data.messages_window > channel->ack_data.client_window * 2)) {
> > +        channel->send_data.blocked = TRUE;
> > +        return NULL;
> > +    }
> >     --channel->pipe_size;
> >     ring_remove(&item->link);
> >     return item;
> > --
> > 1.7.3.4
> >
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel
> >
> 
> 
> 
> -- 
> Marc-André Lureau


More information about the Spice-devel mailing list