From owner-freebsd-current@FreeBSD.ORG Mon May 26 11:33:38 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from miki (localhost [IPv6:::1]) by hub.freebsd.org (Postfix) with SMTP id 65AF8106564A; Mon, 26 May 2008 11:33:36 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Date: Mon, 26 May 2008 19:33:05 +0800 From: Ariff Abdullah To: Kostik Belousov Message-Id: <20080526193305.63459394.ariff@FreeBSD.org> 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> Organization: FreeBSD X-Mailer: /usr/local/lib/ruby/1.8/net/smtp.rb Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Mon__26_May_2008_19_33_05_+0800_6eJ8.9+k.5aFGSab" Cc: freebsd-current@freebsd.org, d@delphij.net 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 11:33:38 -0000 This is a multi-part message in MIME format. --Multipart=_Mon__26_May_2008_19_33_05_+0800_6eJ8.9+k.5aFGSab Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 26 May 2008 12:17:56 +0300 Kostik Belousov wrote: > On Mon, May 26, 2008 at 03:55:14PM +0800, Ariff Abdullah wrote: > > On Sun, 25 May 2008 23:29:45 -0700 > > Xin LI wrote: [...] > > > > It is something new. Let me examine it first. > > 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 see. It's quite new to me since I haven't examine things thoroughly since past few weeks. Thanks. Xin Li, try this patch. -- Ariff Abdullah FreeBSD ... Recording in stereo is obviously too advanced and confusing for us idiot ***** users :P ........ --Multipart=_Mon__26_May_2008_19_33_05_+0800_6eJ8.9+k.5aFGSab Content-Type: text/x-diff; name="dsp.c.diff" Content-Disposition: attachment; filename="dsp.c.diff" Content-Transfer-Encoding: 7bit Index: src/sys/dev/sound/pcm/dsp.c =================================================================== RCS file: /home/ncvs/src/sys/dev/sound/pcm/dsp.c,v retrieving revision 1.108 diff -u -r1.108 dsp.c --- src/sys/dev/sound/pcm/dsp.c 11 Apr 2008 15:26:25 -0000 1.108 +++ src/sys/dev/sound/pcm/dsp.c 26 May 2008 11:26:54 -0000 @@ -661,7 +661,14 @@ * process. */ (void)snd_clone_release(i_dev); + + /* + * destroy_dev() might sleep, so release pcm lock + * here and rely on pcm cv serialization. + */ + pcm_unlock(d); (void)snd_clone_unref(i_dev); + pcm_lock(d); } PCM_RELEASE(d); } --Multipart=_Mon__26_May_2008_19_33_05_+0800_6eJ8.9+k.5aFGSab--