This patch changes the behavior of coropoll so that either poll
dispatches are done, or timers are expired, but never both.  This offers
a pretty big improvement on slower systems, but even on fast systems
such as 5530 cpu not retrieving the monotonic time to determine when to
expire timers makes a difference.

These results generated with corosync-pload
oriiginal
15000000 Writes   300 bytes per write  16.234 Seconds runtime 923975.529
TP/s

with coropoll change
15000000 Writes   300 bytes per write  16.021 Seconds runtime 936258.723
TP/s


Regards
-steve

Index: exec/coropoll.c
===================================================================
--- exec/coropoll.c	(revision 2375)
+++ exec/coropoll.c	(working copy)
@@ -385,25 +385,28 @@
 			goto error_exit;
 		}
 
+		if (res > 0) {
 		poll_entry_count = poll_instance->poll_entry_count;
-		for (i = 0; i < poll_entry_count; i++) {
-			if (poll_instance->ufds[i].fd != -1 &&
-				poll_instance->ufds[i].revents) {
+			for (i = 0; i < poll_entry_count; i++) {
+				if (poll_instance->ufds[i].fd != -1 &&
+					poll_instance->ufds[i].revents) {
 
-				res = poll_instance->poll_entries[i].dispatch_fn (handle,
-					poll_instance->ufds[i].fd,
-					poll_instance->ufds[i].revents,
-					poll_instance->poll_entries[i].data);
+					res = poll_instance->poll_entries[i].dispatch_fn (handle,
+						poll_instance->ufds[i].fd,
+						poll_instance->ufds[i].revents,
+						poll_instance->poll_entries[i].data);
 
-				/*
-				 * Remove dispatch functions that return -1
-				 */
-				if (res == -1) {
-					poll_instance->poll_entries[i].ufd.fd = -1; /* empty entry */
+					/*
+					 * Remove dispatch functions that return -1
+					 */
+					if (res == -1) {
+						poll_instance->poll_entries[i].ufd.fd = -1; /* empty entry */
+					}
 				}
 			}
+		} else {
+			timerlist_expire (&poll_instance->timerlist);
 		}
-		timerlist_expire (&poll_instance->timerlist);
 	} /* for (;;) */
 
 	hdb_handle_put (&poll_instance_database, handle);
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to