From owner-freebsd-current@FreeBSD.ORG Mon May 26 13:42:24 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B190E106566C for ; Mon, 26 May 2008 13:42:24 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:610:652::211]) by mx1.freebsd.org (Postfix) with ESMTP id 738F58FC19 for ; Mon, 26 May 2008 13:42:24 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id B45921CC4D; Mon, 26 May 2008 15:41:25 +0200 (CEST) Date: Mon, 26 May 2008 15:41:25 +0200 From: Ed Schouten To: FreeBSD Current Message-ID: <20080526134125.GD64397@hoeg.nl> References: <483A58D9.4090400@delphij.net> <20080526155514.221a210e.ariff@FreeBSD.org> <20080526091756.GF21317@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rqzD5py0kzyFAOWN" Content-Disposition: inline In-Reply-To: <20080526091756.GF21317@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.18 (2008-05-17) Subject: Re: /dev/soiund/pcm/dsp.c: uma_zalloc with non-sleepable lock held X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2008 13:42:24 -0000 --rqzD5py0kzyFAOWN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Kostik Belousov 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 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--