Просмотр исходного кода

totemsrp: Remove recv_flush code

The recv_flush code is no longer necessary because of the miss_count_count
addition.  It can in some cases lead to register corruption because of
interactions with -fstack-protector, the recursive nature of how this code
works, and interactions with the optimizer in some versions of gcc.

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Steven Dake 15 лет назад
Родитель
Сommit
1a7b7a39f4
8 измененных файлов с 1 добавлено и 122 удалено
  1. 0 10
      exec/totemiba.c
  2. 0 15
      exec/totemnet.c
  3. 0 2
      exec/totemnet.h
  4. 0 54
      exec/totemrrp.c
  5. 0 3
      exec/totemrrp.h
  6. 0 2
      exec/totemsrp.c
  7. 1 29
      exec/totemudp.c
  8. 0 7
      exec/totemudpu.c

+ 0 - 10
exec/totemiba.c

@@ -1339,16 +1339,6 @@ int totemiba_processor_count_set (
 	return (res);
 }
 
-int totemiba_recv_flush (void *iba_context)
-{
-	struct totemiba_instance *instance = (struct totemiba_instance *)iba_context;
-	int res = 0;
-
-	instance = NULL;
-
-	return (res);
-}
-
 int totemiba_send_flush (void *iba_context)
 {
 	struct totemiba_instance *instance = (struct totemiba_instance *)iba_context;

+ 0 - 15
exec/totemnet.c

@@ -93,8 +93,6 @@ struct transport {
 		const void *msg,
 		unsigned int msg_len);
 
-	int (*recv_flush) (void *transport_context);
-
 	int (*send_flush) (void *transport_context);
 
 	int (*iface_check) (void *transport_context);
@@ -139,7 +137,6 @@ struct transport transport_entries[] = {
 		.token_send = totemudp_token_send,
 		.mcast_flush_send = totemudp_mcast_flush_send,
 		.mcast_noflush_send = totemudp_mcast_noflush_send,
-		.recv_flush = totemudp_recv_flush,
 		.send_flush = totemudp_send_flush,
 		.iface_check = totemudp_iface_check,
 		.finalize = totemudp_finalize,
@@ -159,7 +156,6 @@ struct transport transport_entries[] = {
 		.token_send = totemudpu_token_send,
 		.mcast_flush_send = totemudpu_mcast_flush_send,
 		.mcast_noflush_send = totemudpu_mcast_noflush_send,
-		.recv_flush = totemudpu_recv_flush,
 		.send_flush = totemudpu_send_flush,
 		.iface_check = totemudpu_iface_check,
 		.finalize = totemudpu_finalize,
@@ -182,7 +178,6 @@ struct transport transport_entries[] = {
 		.token_send = totemiba_token_send,
 		.mcast_flush_send = totemiba_mcast_flush_send,
 		.mcast_noflush_send = totemiba_mcast_noflush_send,
-		.recv_flush = totemiba_recv_flush,
 		.send_flush = totemiba_send_flush,
 		.iface_check = totemiba_iface_check,
 		.finalize = totemiba_finalize,
@@ -335,16 +330,6 @@ int totemnet_processor_count_set (
 	return (res);
 }
 
-int totemnet_recv_flush (void *net_context)
-{
-	struct totemnet_instance *instance = (struct totemnet_instance *)net_context;
-	int res = 0;
-
-	res = instance->transport->recv_flush (instance->transport_context);
-
-	return (res);
-}
-
 int totemnet_send_flush (void *net_context)
 {
 	struct totemnet_instance *instance = (struct totemnet_instance *)net_context;

+ 0 - 2
exec/totemnet.h

@@ -96,8 +96,6 @@ extern int totemnet_mcast_noflush_send (
 	const void *msg,
 	unsigned int msg_len);
 
-extern int totemnet_recv_flush (void *net_context);
-
 extern int totemnet_send_flush (void *net_context);
 
 extern int totemnet_iface_check (void *net_context);

+ 0 - 54
exec/totemrrp.c

@@ -143,9 +143,6 @@ struct rrp_algo {
 		const void *msg,
 		unsigned int msg_len);
 
-	void (*recv_flush) (
-		struct totemrrp_instance *instance);
-
 	void (*send_flush) (
 		struct totemrrp_instance *instance);
 
@@ -276,9 +273,6 @@ static void none_token_send (
 	const void *msg,
 	unsigned int msg_len);
 
-static void none_recv_flush (
-	struct totemrrp_instance *instance);
-
 static void none_send_flush (
 	struct totemrrp_instance *instance);
 
@@ -346,9 +340,6 @@ static void passive_token_send (
 	const void *msg,
 	unsigned int msg_len);
 
-static void passive_recv_flush (
-	struct totemrrp_instance *instance);
-
 static void passive_send_flush (
 	struct totemrrp_instance *instance);
 
@@ -416,9 +407,6 @@ static void active_token_send (
 	const void *msg,
 	unsigned int msg_len);
 
-static void active_recv_flush (
-	struct totemrrp_instance *instance);
-
 static void active_send_flush (
 	struct totemrrp_instance *instance);
 
@@ -470,7 +458,6 @@ struct rrp_algo none_algo = {
 	.mcast_flush_send	= none_mcast_flush_send,
 	.token_recv		= none_token_recv,
 	.token_send		= none_token_send,
-	.recv_flush		= none_recv_flush,
 	.send_flush		= none_send_flush,
 	.iface_check		= none_iface_check,
 	.processor_count_set	= none_processor_count_set,
@@ -489,7 +476,6 @@ struct rrp_algo passive_algo = {
 	.mcast_flush_send	= passive_mcast_flush_send,
 	.token_recv		= passive_token_recv,
 	.token_send		= passive_token_send,
-	.recv_flush		= passive_recv_flush,
 	.send_flush		= passive_send_flush,
 	.iface_check		= passive_iface_check,
 	.processor_count_set	= passive_processor_count_set,
@@ -508,7 +494,6 @@ struct rrp_algo active_algo = {
 	.mcast_flush_send	= active_mcast_flush_send,
 	.token_recv		= active_token_recv,
 	.token_send		= active_token_send,
-	.recv_flush		= active_recv_flush,
 	.send_flush		= active_send_flush,
 	.iface_check		= active_iface_check,
 	.processor_count_set	= active_processor_count_set,
@@ -594,11 +579,6 @@ static void none_token_send (
 		msg, msg_len);
 }
 
-static void none_recv_flush (struct totemrrp_instance *instance)
-{
-	totemnet_recv_flush (instance->net_handles[0]);
-}
-
 static void none_send_flush (struct totemrrp_instance *instance)
 {
 	totemnet_send_flush (instance->net_handles[0]);
@@ -930,19 +910,6 @@ static void passive_token_send (
 
 }
 
-static void passive_recv_flush (struct totemrrp_instance *instance)
-{
-	struct passive_instance *rrp_algo_instance = (struct passive_instance *)instance->rrp_algo_instance;
-	unsigned int i;
-
-	for (i = 0; i < instance->interface_count; i++) {
-		if (rrp_algo_instance->faulty[i] == 0) {
-
-			totemnet_recv_flush (instance->net_handles[i]);
-		}
-	}
-}
-
 static void passive_send_flush (struct totemrrp_instance *instance)
 {
 	struct passive_instance *rrp_algo_instance = (struct passive_instance *)instance->rrp_algo_instance;
@@ -1325,19 +1292,6 @@ static void active_token_send (
 	}
 }
 
-static void active_recv_flush (struct totemrrp_instance *instance)
-{
-	struct active_instance *rrp_algo_instance = (struct active_instance *)instance->rrp_algo_instance;
-	unsigned int i;
-
-	for (i = 0; i < instance->interface_count; i++) {
-		if (rrp_algo_instance->faulty[i] == 0) {
-
-			totemnet_recv_flush (instance->net_handles[i]);
-		}
-	}
-}
-
 static void active_send_flush (struct totemrrp_instance *instance)
 {
 	struct active_instance *rrp_algo_instance = (struct active_instance *)instance->rrp_algo_instance;
@@ -1701,14 +1655,6 @@ int totemrrp_token_target_set (
 
 	return (0);
 }
-int totemrrp_recv_flush (void *rrp_context)
-{
-	struct totemrrp_instance *instance = (struct totemrrp_instance *)rrp_context;
-
-	instance->rrp_algo->recv_flush (instance);
-
-	return (0);
-}
 
 int totemrrp_send_flush (void *rrp_context)
 {

+ 0 - 3
exec/totemrrp.h

@@ -107,9 +107,6 @@ extern int totemrrp_mcast_flush_send (
 	const void *msg,
 	unsigned int msg_len);
 
-extern int totemrrp_recv_flush (
-	void *rrp_context);
-
 extern int totemrrp_send_flush (
 	void *rrp_context);
 

+ 0 - 2
exec/totemsrp.c

@@ -3419,8 +3419,6 @@ static int message_handler_orf_token (
 	}
 #endif
 
-	totemrrp_recv_flush (instance->totemrrp_context);
-
 	/*
 	 * Determine if we should hold (in reality drop) the token
 	 */

+ 1 - 29
exec/totemudp.c

@@ -1177,11 +1177,7 @@ static int net_deliver_fn (
 	unsigned char *msg_offset;
 	unsigned int size_delv;
 
-	if (instance->flushing == 1) {
-		iovec = &instance->totemudp_iov_recv_flush;
-	} else {
-		iovec = &instance->totemudp_iov_recv;
-	}
+	iovec = &instance->totemudp_iov_recv;
 
 	/*
 	 * Receive datagram
@@ -1859,30 +1855,6 @@ int totemudp_processor_count_set (
 	return (res);
 }
 
-int totemudp_recv_flush (void *udp_context)
-{
-	struct totemudp_instance *instance = (struct totemudp_instance *)udp_context;
-	struct pollfd ufd;
-	int nfds;
-	int res = 0;
-
-	instance->flushing = 1;
-
-	do {
-		ufd.fd = instance->totemudp_sockets.mcast_recv;
-		ufd.events = POLLIN;
-		nfds = poll (&ufd, 1, 0);
-		if (nfds == 1 && ufd.revents & POLLIN) {
-		net_deliver_fn (0, instance->totemudp_sockets.mcast_recv,
-			ufd.revents, instance);
-		}
-	} while (nfds == 1);
-
-	instance->flushing = 0;
-
-	return (res);
-}
-
 int totemudp_send_flush (void *udp_context)
 {
 	struct totemudp_instance *instance = (struct totemudp_instance *)udp_context;

+ 0 - 7
exec/totemudpu.c

@@ -1503,13 +1503,6 @@ int totemudpu_processor_count_set (
 	return (res);
 }
 
-int totemudpu_recv_flush (void *udpu_context)
-{
-	int res = 0;
-
-	return (res);
-}
-
 int totemudpu_send_flush (void *udpu_context)
 {
 	int res = 0;