[PATCH] Example short-circuit of totem for single node cases - for TESTING ONLY

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

 



This example shows (not elegantly) what type of performance corosync would
obtain by short-circuiting totem in single node cases.

This will break gloriously on multi-node systems.

DO NOT MERGE.

Signed-off-by: Steven Dake <sdake@xxxxxxxxxx>
---
 exec/totempg.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/exec/totempg.c b/exec/totempg.c
index abaaf6b..6961665 100644
--- a/exec/totempg.c
+++ b/exec/totempg.c
@@ -1154,6 +1154,8 @@ int totempg_groups_leave (
 #define MAX_IOVECS_FROM_APP 32
 #define MAX_GROUPS_PER_MSG 32
 
+static char global_msg[10000000];
+
 int totempg_groups_mcast_joined (
 	void *totempg_groups_instance,
 	const struct iovec *iovec,
@@ -1165,6 +1167,15 @@ int totempg_groups_mcast_joined (
 	struct iovec iovec_mcast[MAX_GROUPS_PER_MSG + 1 + MAX_IOVECS_FROM_APP];
 	int i;
 	unsigned int res;
+	unsigned int msg_len;
+
+	msg_len = 0;
+	for (i = 0; i < iov_len; i++) {
+		memcpy (&global_msg[msg_len], iovec[i].iov_base, iovec[i].iov_len);
+		msg_len += iovec[i].iov_len;
+	}
+	instance->deliver_fn (totempg_my_nodeid_get(), global_msg, msg_len, 0);
+	return 0;
 
 	if (totempg_threaded_mode == 1) {
 		pthread_mutex_lock (&totempg_mutex);
-- 
1.7.7.6

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux