Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 May 2008 15:41:25 +0200
From:      Ed Schouten <ed@80386.nl>
To:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: /dev/soiund/pcm/dsp.c: uma_zalloc with non-sleepable lock held
Message-ID:  <20080526134125.GD64397@hoeg.nl>
In-Reply-To: <20080526091756.GF21317@deviant.kiev.zoral.com.ua>
References:  <483A58D9.4090400@delphij.net> <20080526155514.221a210e.ariff@FreeBSD.org> <20080526091756.GF21317@deviant.kiev.zoral.com.ua>

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

--rqzD5py0kzyFAOWN
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Kostik Belousov <kostikbel@gmail.com> wrote:
> Not quite. You cannot hold a mutex over the destroy_dev(), because
> the destroy_dev() may sleep. It was not very common situation, because
> it requires another thread still in the driver methods to trigger the
> problem. Now, because the malloc() is called unconditionally in the
> destroy_dev() since rev. 1.212, the problem gets hit regularly.

I was looking around, but I couldn't find it. Isn't there some kind of
macro that does something like this:

| void
| myfunction(void)
| {
| 	THREAD_CANNOT_HOLD_ANY_NONSLEEPABLE_LOCKS_HERE;
|=20
| 	...
| }

I know we have THREAD_NO_SLEEPING(), but that just does the opposite. I
think we could greatly improve our warnings if we could add these
macro's throughout the source code.

--=20
 Ed Schouten <ed@80386.nl>
 WWW: http://80386.nl/

--rqzD5py0kzyFAOWN
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkg6vgUACgkQ52SDGA2eCwXdfwCdFfwRiTfvpI72NgKD6/e6xvEA
maEAnifsh4qvqvvy0tz0zS3arwdPTw4E
=JADG
-----END PGP SIGNATURE-----

--rqzD5py0kzyFAOWN--



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