aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/uipc_socket.c
diff options
context:
space:
mode:
authorAndre Oppermann <andre@FreeBSD.org>2013-04-09 21:02:20 +0000
committerAndre Oppermann <andre@FreeBSD.org>2013-04-09 21:02:20 +0000
commite8b3186b6a975ea4e701ece75215d9ed6ea7ea4d (patch)
treee754fcc273d884acf419c8faf5d21332f374104e /sys/kern/uipc_socket.c
parent982c1675ff8864f51007e0be402ead88429222bb (diff)
downloadsrc-e8b3186b6a975ea4e701ece75215d9ed6ea7ea4d.tar.gz
src-e8b3186b6a975ea4e701ece75215d9ed6ea7ea4d.zip
Change certain heavily used network related mutexes and rwlocks to
reside on their own cache line to prevent false sharing with other nearby structures, especially for those in the .bss segment. NB: Those mutexes and rwlocks with variables next to them that get changed on every invocation do not benefit from their own cache line. Actually it may be net negative because two cache misses would be incurred in those cases.
Notes
Notes: svn path=/head/; revision=249318
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r--sys/kern/uipc_socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 259a1232fc65..0e3a74ce1eec 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -240,14 +240,14 @@ SYSCTL_INT(_kern_ipc_zero_copy, OID_AUTO, send, CTLFLAG_RW,
* accept_mtx locks down per-socket fields relating to accept queues. See
* socketvar.h for an annotation of the protected fields of struct socket.
*/
-struct mtx accept_mtx;
+struct mtx_padalign accept_mtx;
MTX_SYSINIT(accept_mtx, &accept_mtx, "accept", MTX_DEF);
/*
* so_global_mtx protects so_gencnt, numopensockets, and the per-socket
* so_gencnt field.
*/
-static struct mtx so_global_mtx;
+static struct so_global_mtx so_global_mtx;
MTX_SYSINIT(so_global_mtx, &so_global_mtx, "so_glabel", MTX_DEF);
/*