Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Dec 2004 20:43:34 +0000
From:      Darren Reed <darrenr@hub.freebsd.org>
To:        alc@cs.rice.edu
Cc:        cvs-src@freebsd.org
Subject:   Re: cvs commit: src/sys/contrib/ipfilter/netinet ip_auth.c
Message-ID:  <20041228204334.GA12977@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

> Deadlock is not the issue.  The implementations of mutex and sx locks
> don't support the acquisition of mutexes before sx locks.  Roughly
> speaking, when a thread is blocked during the acquisition of a held sx
> lock, it blocks in a manner similar to tsleep().  For the same reasons
> that you can't hold a mutex across a tsleep(), you can't hold a mutex
> when acquiring an sx lock.  

To delve further into this, what is it specifically about sx(9) that
is a problem here ?  Is it that the thread will sleep on a queue
because it uses cv_wait/cv_broadcast ?

Is there a PR filed that documents the shortcomings of sx(9) so that
the shortcomings of sx(9) are clearly documented for others to see,
understand and perhaps fix ?

There are so many different things that are wrong here, in FreeBSD,
that I just don't know where to start with PR's...but I hope fixing
sx(9) is very high on someone's list.  So far pfil & ipfw both have
their own sx(9)-variant...how many more times will that framework be
copied, I wonder ?

Darren



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041228204334.GA12977>