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

Re: [Xen-devel] [PATCH v2] libxl: reimplement buffer for bootloading and drop data if buffer is full



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.