Re: HEADS UP: UNIX domain socket locking changes merged to CVS HEAD

From: Stephane E. Potvin <sepotvin_at_FreeBSD.org>
Date: Thu, 01 Mar 2007 12:33:38 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Watson wrote:
> 
> On Wed, 28 Feb 2007, Stephane E. Potvin wrote:
> 
>>> Please let me know if you experience any problems with UNIX domain
>>> sockets -- these changes will affect applications that consume UNIX
>>> domain sockets directly, like MySQL and Postfix, as well as consumers
>>> of POSIX fifos, which are implemented using UNIX domain sockets
>>> in-kernel.
>>
>> Since this commit, I've been observing frequent deadlocks on my
>> laptop, mostly when starting-up gnome. It usually takes less than 5 to
>> 10 minutes for the deadlock to happens.
>>
>> I was able to drop into ddb once and got the following information:
>> (there might be some typos as I had to copy this manually)
> 
> Thanks, this information was very helpful, and indeed the problem is as
> you surmise: cases existed where more than one unpcb lock was acquired
> at a time when holding only a global read lock, not a global write
> lock.  I guess these slipped through from an earlier version of the
> patch.  In any case, could you try the patch at:
> 
>   http://www.watson.org/~robert/freebsd/netperf/20070228-unp_deadlock.diff
> 
> This eliminates overlapped unpcb lock acquisition in both datagram and
> stream cases, and with any luck will fix the deadlock problem.  It may
> also marginally improve performance by further reducing unpcb lock
> contention.
> 

The attached patch fixes the deadlock that I was experiencing. The
laptop used to deadlock within a few minutes and I've been running with
the patch for around 3 hours so far without problems. Thanks a lot for
the quick fix.

Regards

Steph
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF5w5xmdOXtTCX/nsRAqpkAJ0RVBn/q5ZFk3AYO1mXJCOQie4HygCfVWjX
Ut3ruvvdZjCczPqSNHjA6Mo=
=qKEm
-----END PGP SIGNATURE-----
Received on Thu Mar 01 2007 - 16:33:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:06 UTC