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] pygrub: make it work

Ian Jackson wrote:

I think it would be better to have something that is the same
everywhere so I'd encourage you to resubmit without the special
casing (and I'll help fix it if it goes wrong).

I don't have much time right now to test on Linux, but I'll see if I can. Maybe Christoph can too.

Yes, that's a good explanation of the new code.  What seems to be
lacking is an explanation of what was wrong with the old code - ie,
what should go in the changeset comment.


The comments do explain what was wrong with the old code..

The old code had the following problems:

1) It was reading and writing data one byte at the time, leading
   to overhead. However, it's safe to try to read/write bigger
   chunks, since the filedescriptors are NDELAY.
2) Instead of checking len(outbuf) / len(inbuf) for writes,
   simply do not include those filedescriptors in the select if there is
   nothing to write. Otherwise, the loop would run around in circles:
   the select would find that the output filedescriptors were writeable,
   but then the loop code would find that it had nothing to write to
   them. In the next iteration, the write filedescs would still be
   writeable, so select returns immediately, but there would still be no
   data to write. Etc, etc. It was essentially a while (1) until
   there was actual data to write. A waste of CPU cycles.

- Frank

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

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