summaryrefslogtreecommitdiff
path: root/usr/src/uts/common
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2011-04-21 20:06:37 -0400
committerJerry Jelinek <jerry.jelinek@joyent.com>2011-04-21 20:06:37 -0400
commitaec2a073cb6e147203523e22c65a90f3f736f08c (patch)
tree8fa166a08d967558f12e118123d21459df91e97a /usr/src/uts/common
parent5a74db2d25b207135db8a909479fc4fb8a27b15d (diff)
downloadillumos-joyent-aec2a073cb6e147203523e22c65a90f3f736f08c.tar.gz
916 False-sharing in TCP hash buckets, plus size increase
Reviewed by: Dan McDonald <danmcd@nexenta.com> Reviewed by: Richard Lowe <richlowe@richlowe.net> Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/uts/common')
-rw-r--r--usr/src/uts/common/inet/tcp.h6
-rw-r--r--usr/src/uts/common/inet/tcp/tcp.c3
-rw-r--r--usr/src/uts/common/inet/tcp_impl.h3
3 files changed, 10 insertions, 2 deletions
diff --git a/usr/src/uts/common/inet/tcp.h b/usr/src/uts/common/inet/tcp.h
index cbf07edce8..460f183884 100644
--- a/usr/src/uts/common/inet/tcp.h
+++ b/usr/src/uts/common/inet/tcp.h
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
*/
/* Copyright (c) 1990 Mentat Inc. */
@@ -496,6 +497,9 @@ extern void *tcp_get_conn(void *arg, tcp_stack_t *);
extern mblk_t *tcp_snmp_get(queue_t *, mblk_t *, boolean_t);
extern int tcp_snmp_set(queue_t *, int, int, uchar_t *, int len);
+/* Pad for the tf_t structure to avoid false cache line sharing. */
+#define TF_CACHEL_PAD 64
+
/*
* The TCP Fanout structure for bind and acceptor hashes.
* The hash tables and their linkage (tcp_*_hash, tcp_ptp*hn) are
@@ -508,6 +512,8 @@ extern int tcp_snmp_set(queue_t *, int, int, uchar_t *, int len);
typedef struct tf_s {
tcp_t *tf_tcp;
kmutex_t tf_lock;
+ unsigned char tf_pad[TF_CACHEL_PAD -
+ (sizeof (tcp_t *) + sizeof (kmutex_t))];
} tf_t;
diff --git a/usr/src/uts/common/inet/tcp/tcp.c b/usr/src/uts/common/inet/tcp/tcp.c
index 7ebd55b572..8d3dacf35b 100644
--- a/usr/src/uts/common/inet/tcp/tcp.c
+++ b/usr/src/uts/common/inet/tcp/tcp.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
/* Copyright (c) 1990 Mentat Inc. */
@@ -240,7 +241,7 @@ uint_t tcp_free_list_max_cnt = 0;
/*
* Size of acceptor hash list. It has to be a power of 2 for hashing.
*/
-#define TCP_ACCEPTOR_FANOUT_SIZE 256
+#define TCP_ACCEPTOR_FANOUT_SIZE 512
#ifdef _ILP32
#define TCP_ACCEPTOR_HASH(accid) \
diff --git a/usr/src/uts/common/inet/tcp_impl.h b/usr/src/uts/common/inet/tcp_impl.h
index d1a1757853..12f201b960 100644
--- a/usr/src/uts/common/inet/tcp_impl.h
+++ b/usr/src/uts/common/inet/tcp_impl.h
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
#ifndef _INET_TCP_IMPL_H
@@ -55,7 +56,7 @@ extern sock_downcalls_t sock_tcp_downcalls;
* Bind hash list size and has function. It has to be a power of 2 for
* hashing.
*/
-#define TCP_BIND_FANOUT_SIZE 512
+#define TCP_BIND_FANOUT_SIZE 1024
#define TCP_BIND_HASH(lport) (ntohs(lport) & (TCP_BIND_FANOUT_SIZE - 1))
/*