Skip to contentSkip to conversation

Work around pvops lost event channel bug

PATCH New Ian Jackson 1 participant 1 message Oct 12, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Work around pvops lost event channel bug

Our automated tests are failing to push because, with some probability, a lost event channel event makes xenconsoled, and the domU get stuck.

We think this is going to be fixed by
http://xenbits.xen.org/gitweb?p=people/ianc/linux-2.6.git;a=commit;h=5d30cb2a85912ffb5f6556d55472c26801eef2ea
http://lists.xensource.com/archives/html/xen-devel/2010-10/msg00370.html

But here is a workaround (against xen-4.0-testing) that in my tests seemed to make dom0 xenconsoled unwedge.

Ian.

tools/console/daemon/io.c +6 -6
diff -r c32e9163328d tools/console/daemon/io.c
@@ -891,8 +891,9 @@ static void handle_ring_read(struct doma
 	if (dom->is_dead)
 		return;
 
-	if ((port = xc_evtchn_pending(dom->xce_handle)) == -1)
-		return;
+//	if ((port = xc_evtchn_pending(dom->xce_handle)) == -1)
+//		return;
+	port = dom->local_port;
 
 	dom->event_count++;
 
@@ -975,6 +976,7 @@ void handle_io(void)
 {
 	fd_set readfds, writefds;
 	int ret;
+	static struct timeval abs_max_timeout = { 10, 0 };
 
 	if (log_hv) {
 		xc_handle = xc_interface_open();
@@ -1076,7 +1078,7 @@ void handle_io(void)
 		}
 
 		ret = select(max_fd + 1, &readfds, &writefds, 0,
-			     next_timeout ? &timeout : NULL);
+			     next_timeout ? &timeout : &abs_max_timeout);
 
 		if (log_reload) {
 			handle_log_reload();
@@ -1105,9 +1107,7 @@ void handle_io(void)
 		for (d = dom_head; d; d = n) {
 			n = d->next;
 			if (d->event_count < RATE_LIMIT_ALLOWANCE) {
-				if (d->xce_handle != -1 &&
-				    FD_ISSET(xc_evtchn_fd(d->xce_handle),
-					     &readfds))
+				if (d->xce_handle != -1)
 					handle_ring_read(d);
 			}