]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Revise locking strategy used for UNIX domain sockets in order to improve
authorRobert Watson <rwatson@FreeBSD.org>
Mon, 26 Feb 2007 20:47:52 +0000 (20:47 +0000)
committerRobert Watson <rwatson@FreeBSD.org>
Mon, 26 Feb 2007 20:47:52 +0000 (20:47 +0000)
commite7c33e29eda17610cdaad10c6be9a35e05721322
tree54a8b6877ce01fc143b93df18b1783539873c273
parentc0e767f9dd8a0f1b2922fe671e96eec0ff51831e
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)
sys/kern/uipc_usrreq.c
sys/sys/unpcb.h