WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH v2] libxl: reimplement buffer for bootloading and

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH v2] libxl: reimplement buffer for bootloading and drop data if buffer is full
From: Roger Pau Monné <roger.pau@xxxxxxxxxxxxx>
Date: Tue, 18 Oct 2011 12:35:08 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Ian.Campbell@xxxxxxxxxx
Delivery-date: Tue, 18 Oct 2011 03:36:21 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=aOmvREhGd5RQM4DQCnQrJkAYJo3mZPzziw5NK0fW3ss=; b=IivQKY7dInDO9b29P7b409cLLDHK3zqv+kzAK0fJ8T22QnupZaF7fioU5bZSqJY0ua 5qFBwb2lo4Jxa5VectdSSFsPMj4vIHg0DcjOBxbgzGbKlmRvGHvG3bT0bk3tsWtHKiW0 RIF4nRc21aYLKJba98L6wISl7WyWbe5CMiuaU=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20124.21759.342541.404863@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <72ef13cb4609c97a26ef.1318503856@loki> <20124.21759.342541.404863@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
2011/10/17 Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>:
> Roger Pau Monne writes ("[Xen-devel] [PATCH v2] libxl: reimplement buffer for 
> bootloading and drop data if buffer is full"):
>> +        /* Move buffers around to drop already consumed data */
>> +        if (xenconsoled_cons > 0) {
>> +            xenconsoled_prod -= xenconsoled_cons;
>> +            memmove(xenconsoled_buf, &xenconsoled_buf[xenconsoled_cons], 
>> xenconsoled_prod);
>
> This has quite a few overly-long lines.  Can you keep them to 75ish
> please ?
>
>> -        ret = select(nfds, &rsel, &wsel, NULL, NULL);
>> +        ret = select(nfds, &rsel, &wsel, NULL, &wait);
>>          if (ret < 0)
>>              goto out_err;
>
> This needs to handle EINTR.  Ie, if EINTR happens, just loop again.
> (A better implementation would actually subtract the timeout but
> let's not do that now).
>
>> +        timeout = ret == 0 ? 1 : 0;
>
> This seems a slightly odd approach.  How about
>  if (ret==0) {
>     empty the ring buffer

When talking with Ian Campbell we decided to avoid cleaning the whole
buffer, and instead append data at the end, to prevent loosing more
output than necessary.

>     continue;
>  }
> ?
>
> And you should avoid setting a timeout if the buffer is empty, so that
> a completely idle setup just sits and waits rather than polling every
> second.

Yes, will fix that.

> Ian.
>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>