From owner-freebsd-current@FreeBSD.ORG Thu Sep 15 06:35:54 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 381AF16A41F for ; Thu, 15 Sep 2005 06:35:54 +0000 (GMT) (envelope-from skywizard@MyBSD.org.my) Received: from tomoyo.MyBSD.org.my (tomoyo.mybsd.org.my [202.157.186.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E1A543D53 for ; Thu, 15 Sep 2005 06:35:53 +0000 (GMT) (envelope-from skywizard@MyBSD.org.my) Received: from localhost (localhost [127.0.0.1]) by tomoyo.MyBSD.org.my (Postfix) with ESMTP id 35F626CC3D; Thu, 15 Sep 2005 14:43:53 +0800 (MYT) Received: from tomoyo.MyBSD.org.my ([127.0.0.1]) by localhost (tomoyo.MyBSD.org.my [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 75845-08; Thu, 15 Sep 2005 14:43:52 +0800 (MYT) Received: from kasumi.MyBSD.org.my (unknown [218.111.181.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tomoyo.MyBSD.org.my (Postfix) with ESMTP id 434C06CC22; Thu, 15 Sep 2005 14:43:48 +0800 (MYT) Date: Thu, 15 Sep 2005 14:35:40 +0800 From: Ariff Abdullah To: pyunyh@gmail.com, minimarmot@gmail.com Message-Id: <20050915143540.72b66996.skywizard@MyBSD.org.my> In-Reply-To: <20050915043448.GB18332@rndsoft.co.kr> References: <47d0403c05091121047a037946@mail.gmail.com> <20050912044212.GC5182@rndsoft.co.kr> <47d0403c05091122276fd0a231@mail.gmail.com> <20050913070149.GE9481@rndsoft.co.kr> <47d0403c0509131235ed58122@mail.gmail.com> <20050914014830.GA13631@rndsoft.co.kr> <20050915033848.2d87da42.skywizard@MyBSD.org.my> <20050915014509.GA17602@rndsoft.co.kr> <20050915114653.431f17c5.skywizard@MyBSD.org.my> <20050915043448.GB18332@rndsoft.co.kr> Organization: MyBSD X-Mailer: /usr/local/lib/ruby/1.8/net/smtp.rb Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-antivirus-mail-gateway at TOMOYO.MYBSD.ORG.MY Cc: freebsd-current@freebsd.org Subject: Re: panic upon kldunload snd_ich (lor # 159) 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: Thu, 15 Sep 2005 06:35:54 -0000 On Thu, 15 Sep 2005 13:34:48 +0900 Pyun YongHyeon wrote: > On Thu, Sep 15, 2005 at 11:46:53AM +0800, Ariff Abdullah wrote: > > On Thu, 15 Sep 2005 10:45:09 +0900 > > Pyun YongHyeon wrote: > > > > > > That would be supposed to fix the LOR message. But I'd like to > > > keep lock ordering between snd_mutex and sndstat_lock. Since > > > sndstat_read() could be called at any time there is an implicit > > > lock order. I think switching to sx lock from mutex in sndstat > > > code was to allow uiomove with lock held. IMO, it would be even > > > better to rewrite sndstat_read() without using uiomove such that > > > it can also use standard mutex rather than sx lock. > > > > > I tend to agree with you. Since that sndstat_busy() isn't enough, > > how about we acquire the entire sndstat so nobody can monkey with > > it (as the proposed / attached diff) and at the same time avoiding > > this LOR message. It seems much better rather than locking sndstat > > after sndstat_busy() and much of pcm_unregister() procedures, only > > to find out that somebody acquire it within that moment. > > > > I didn't try the patch but it looks good to me. :-) > If you have more time would you please fix race in sndstat_open()? > > Minor note : I think it is better to use sx_xunlock ranther than > sx_unlock as sx_xunlock clearly indicates which type of locks held. > o my, that was a mass typo. Will fix it. -- Ariff Abdullah MyBSD http://www.MyBSD.org.my (IPv6/IPv4) http://staff.MyBSD.org.my (IPv6/IPv4) http://tomoyo.MyBSD.org.my (IPv6/IPv4)