From owner-freebsd-current@FreeBSD.ORG Mon May 26 13:49:11 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 0A3B2106566C for ; Mon, 26 May 2008 13:49:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 5F27C8FC13 for ; Mon, 26 May 2008 13:49:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m4QDmoZj076366 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 26 May 2008 16:48:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m4QDmoM5099250; Mon, 26 May 2008 16:48:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m4QDmoMA099249; Mon, 26 May 2008 16:48:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 26 May 2008 16:48:50 +0300 From: Kostik Belousov To: Ed Schouten Message-ID: <20080526134850.GK21317@deviant.kiev.zoral.com.ua> References: <483A58D9.4090400@delphij.net> <20080526155514.221a210e.ariff@FreeBSD.org> <20080526091756.GF21317@deviant.kiev.zoral.com.ua> <20080526134125.GD64397@hoeg.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aziWXe2aaRGlkyg3" Content-Disposition: inline In-Reply-To: <20080526134125.GD64397@hoeg.nl> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on skuns.kiev.zoral.com.ua Cc: FreeBSD Current 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:49:11 -0000 --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 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--