diff options
author | David Teigland <teigland@redhat.com> | 2010-11-12 12:12:55 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2010-11-12 12:12:55 -0500 |
commit | cb2d45da81c86d5191b19d0f67732a854bc0253c (patch) | |
tree | 6220ce5780e13684024f2693f66f5749c2cb472c /fs/dlm | |
parent | dcce240ead802d42b1e45ad2fcb2ed4a399cb255 (diff) |
dlm: use TCP_NODELAY
Nagling doesn't help and can sometimes hurt dlm comms.
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm')
-rw-r--r-- | fs/dlm/lowcomms.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 1d4e644c6589..2bedb0ac5f92 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c | |||
@@ -926,6 +926,7 @@ static void tcp_connect_to_sock(struct connection *con) | |||
926 | struct sockaddr_storage saddr, src_addr; | 926 | struct sockaddr_storage saddr, src_addr; |
927 | int addr_len; | 927 | int addr_len; |
928 | struct socket *sock = NULL; | 928 | struct socket *sock = NULL; |
929 | int one = 1; | ||
929 | 930 | ||
930 | if (con->nodeid == 0) { | 931 | if (con->nodeid == 0) { |
931 | log_print("attempt to connect sock 0 foiled"); | 932 | log_print("attempt to connect sock 0 foiled"); |
@@ -971,6 +972,11 @@ static void tcp_connect_to_sock(struct connection *con) | |||
971 | make_sockaddr(&saddr, dlm_config.ci_tcp_port, &addr_len); | 972 | make_sockaddr(&saddr, dlm_config.ci_tcp_port, &addr_len); |
972 | 973 | ||
973 | log_print("connecting to %d", con->nodeid); | 974 | log_print("connecting to %d", con->nodeid); |
975 | |||
976 | /* Turn off Nagle's algorithm */ | ||
977 | kernel_setsockopt(sock, SOL_TCP, TCP_NODELAY, (char *)&one, | ||
978 | sizeof(one)); | ||
979 | |||
974 | result = | 980 | result = |
975 | sock->ops->connect(sock, (struct sockaddr *)&saddr, addr_len, | 981 | sock->ops->connect(sock, (struct sockaddr *)&saddr, addr_len, |
976 | O_NONBLOCK); | 982 | O_NONBLOCK); |
@@ -1022,6 +1028,10 @@ static struct socket *tcp_create_listen_sock(struct connection *con, | |||
1022 | goto create_out; | 1028 | goto create_out; |
1023 | } | 1029 | } |
1024 | 1030 | ||
1031 | /* Turn off Nagle's algorithm */ | ||
1032 | kernel_setsockopt(sock, SOL_TCP, TCP_NODELAY, (char *)&one, | ||
1033 | sizeof(one)); | ||
1034 | |||
1025 | result = kernel_setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, | 1035 | result = kernel_setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, |
1026 | (char *)&one, sizeof(one)); | 1036 | (char *)&one, sizeof(one)); |
1027 | 1037 | ||