From owner-freebsd-current@FreeBSD.ORG Thu Sep 15 09:35:10 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 2F88C16A41F for ; Thu, 15 Sep 2005 09:35:10 +0000 (GMT) (envelope-from Alexander@Leidinger.net) Received: from www.ebusiness-leidinger.de (jojo.ms-net.de [84.16.236.246]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7308643D4C for ; Thu, 15 Sep 2005 09:35:08 +0000 (GMT) (envelope-from Alexander@Leidinger.net) Received: from Andro-Beta.Leidinger.net (p54A5CF6E.dip.t-dialin.net [84.165.207.110]) (authenticated bits=0) by www.ebusiness-leidinger.de (8.13.1/8.13.1) with ESMTP id j8F9MkHU087797; Thu, 15 Sep 2005 11:23:10 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from localhost (localhost [127.0.0.1]) by Andro-Beta.Leidinger.net (8.13.3/8.13.3) with ESMTP id j8F9XtMn007647; Thu, 15 Sep 2005 11:33:55 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by netchild.homeip.net (Horde MIME library) with HTTP; Thu, 15 Sep 2005 11:33:54 +0200 Message-ID: <20050915113354.iv5u8ycfksscw4wk@netchild.homeip.net> X-Priority: 3 (Normal) Date: Thu, 15 Sep 2005 11:33:54 +0200 From: Alexander Leidinger To: pyunyh@gmail.com 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> In-Reply-To: <20050915043448.GB18332@rndsoft.co.kr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.0.3) / FreeBSD-4.11 X-Virus-Scanned: by amavisd-new Cc: freebsd-current@freebsd.org, Ariff Abdullah Subject: documenting the locking requirements? (was: 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 09:35:10 -0000 Pyun YongHyeon wrote: > > 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. Are the locking requirements (what needs to be locked and why/when, in which order) in the sound code documented somewhere? If yes: where? If no: can I convince you (either one or both of "you") to write something up (plain text would be enough for a start)? Bye, Alexander. -- http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 Overheard: "How do I feel? Great! And I kiss pretty good, too!"