Date: Mon, 26 May 2008 16:48:50 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: Ed Schouten <ed@80386.nl> Cc: FreeBSD Current <freebsd-current@freebsd.org> Subject: Re: /dev/soiund/pcm/dsp.c: uma_zalloc with non-sleepable lock held Message-ID: <20080526134850.GK21317@deviant.kiev.zoral.com.ua> In-Reply-To: <20080526134125.GD64397@hoeg.nl> References: <483A58D9.4090400@delphij.net> <20080526155514.221a210e.ariff@FreeBSD.org> <20080526091756.GF21317@deviant.kiev.zoral.com.ua> <20080526134125.GD64397@hoeg.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
--aziWXe2aaRGlkyg3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 26, 2008 at 03:41:25PM +0200, Ed Schouten wrote: > * 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. >=20 > I was looking around, but I couldn't find it. Isn't there some kind of > macro that does something like this: >=20 > | void > | myfunction(void) > | { > | THREAD_CANNOT_HOLD_ANY_NONSLEEPABLE_LOCKS_HERE; > |=20 > | ... > | } >=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. I believe this is spelled WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "Some msg"); --aziWXe2aaRGlkyg3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkg6v8EACgkQC3+MBN1Mb4iAegCg5xB3v2UIRs/K6EvxSBmJ30GP CNwAn0RYM/tSbCc6hmYZQ253kHBuOqGp =v2Y0 -----END PGP SIGNATURE----- --aziWXe2aaRGlkyg3--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080526134850.GK21317>