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

Re: [Xen-devel] [PATCH V4] Switch from select() to poll() in xenconsoled's IO loop



On 07/01/13 15:01, Wei Liu wrote:
On Mon, 2013-01-07 at 14:41 +0000, Mats Petersson wrote:

                          return;
@@ -982,11 +1024,7 @@ void handle_io(void)
                  /* Re-calculate any event counter allowances & unblock
                     domains with new allowance */
                  for (d = dom_head; d; d = d->next) {
-                       /* Add 5ms of fuzz since select() often returns
-                          a couple of ms sooner than requested. Without
-                          the fuzz we typically do an extra spin in select()
-                          with a 1/2 ms timeout every other iteration */
-                       if ((now+5) > d->next_period) {
+                       if (now > d->next_period) {
Is poll more accurate than select? I would have thought that they were
based on the same timing, and thus equally "fuzzy"?
Is there any actual proof that the fuzz is needed? Specs of both
select() and poll() don't seem to mention this behaviour at all.
That's a good question. I don't know. The tricky part with this sort of thing is that it may well depend on configurations, hardware differences, etc, so you may find that it works just fine on your test-box, but some big customer with Another-brand Co's servers don't work, because there is some subtle difference in hardware. Or it stops working if you have more than X number of CPU's. If you are convinced it's fine as it is, then by all means. I'm just thinking that it probably wasn't put there "by accident".

--
Mats

   #include "utils.h"

   struct xs_handle *xs;
+struct pollfd *xs_pollfd;
I don't see this used outside of io.c  - am I missing something?

Adding more dependencies between different source files seems
unnecessary...

Fixed.


Wei.




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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