path: root/sys/sys
diff options
authorRobert Watson <rwatson@FreeBSD.org>2007-02-26 20:47:52 +0000
committerRobert Watson <rwatson@FreeBSD.org>2007-02-26 20:47:52 +0000
commite7c33e29eda17610cdaad10c6be9a35e05721322 (patch)
tree54a8b6877ce01fc143b93df18b1783539873c273 /sys/sys
parentc0e767f9dd8a0f1b2922fe671e96eec0ff51831e (diff)
Revise locking strategy used for UNIX domain sockets in order to improve
concurrency: - Add per-unpcb mutexes protecting unpcb connection state, fields, etc. - Replace global UNP mutex with a global UNP rwlock, which will protect the UNIX domain socket connection topology, v_socket, and be acquired exclusively before acquiring more than per-unpcb at a time in order to avoid lock order issues. In performance measurements involving MySQL, this change has little or no overhead on UP (+/- 1%), but leads to a significant (5%-30%) improvement in multi-processor measurements using the sysbench and supersmack benchmarks. Much testing by: kris Approved by: re (kensmith)
Notes: svn path=/head/; revision=167030
Diffstat (limited to 'sys/sys')
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/unpcb.h b/sys/sys/unpcb.h
index 129583dbe804..c7b3a44588ef 100644
--- a/sys/sys/unpcb.h
+++ b/sys/sys/unpcb.h
@@ -79,6 +79,7 @@ struct unpcb {
int unp_flags; /* flags */
struct xucred unp_peercred; /* peer credentials, if applicable */
u_int unp_refcount;
+ struct mtx unp_mtx; /* mutex */