aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2010-11-12 11:12:55 -0600
committerDavid Teigland <teigland@redhat.com>2010-11-12 11:12:55 -0600
commitcb2d45da81c86d5191b19d0f67732a854bc0253c (patch)
tree6220ce5780e13684024f2693f66f5749c2cb472c /fs/dlm
parentdcce240ead802d42b1e45ad2fcb2ed4a399cb255 (diff)
downloadkernel_samsung_crespo-cb2d45da81c86d5191b19d0f67732a854bc0253c.zip
kernel_samsung_crespo-cb2d45da81c86d5191b19d0f67732a854bc0253c.tar.gz
kernel_samsung_crespo-cb2d45da81c86d5191b19d0f67732a854bc0253c.tar.bz2
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.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 1d4e644..2bedb0a 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -926,6 +926,7 @@ static void tcp_connect_to_sock(struct connection *con)
struct sockaddr_storage saddr, src_addr;
int addr_len;
struct socket *sock = NULL;
+ int one = 1;
if (con->nodeid == 0) {
log_print("attempt to connect sock 0 foiled");
@@ -971,6 +972,11 @@ static void tcp_connect_to_sock(struct connection *con)
make_sockaddr(&saddr, dlm_config.ci_tcp_port, &addr_len);
log_print("connecting to %d", con->nodeid);
+
+ /* Turn off Nagle's algorithm */
+ kernel_setsockopt(sock, SOL_TCP, TCP_NODELAY, (char *)&one,
+ sizeof(one));
+
result =
sock->ops->connect(sock, (struct sockaddr *)&saddr, addr_len,
O_NONBLOCK);
@@ -1022,6 +1028,10 @@ static struct socket *tcp_create_listen_sock(struct connection *con,
goto create_out;
}
+ /* Turn off Nagle's algorithm */
+ kernel_setsockopt(sock, SOL_TCP, TCP_NODELAY, (char *)&one,
+ sizeof(one));
+
result = kernel_setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
(char *)&one, sizeof(one));