Date: Thu, 15 Sep 2005 13:34:48 +0900 From: Pyun YongHyeon <pyunyh@gmail.com> To: Ariff Abdullah <skywizard@MyBSD.org.my> Cc: freebsd-current@freebsd.org, minimarmot@gmail.com Subject: Re: panic upon kldunload snd_ich (lor # 159) Message-ID: <20050915043448.GB18332@rndsoft.co.kr> In-Reply-To: <20050915114653.431f17c5.skywizard@MyBSD.org.my> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Sep 15, 2005 at 11:46:53AM +0800, Ariff Abdullah wrote: > On Thu, 15 Sep 2005 10:45:09 +0900 > Pyun YongHyeon <pyunyh@gmail.com> 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. -- Regards, Pyun YongHyeon
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050915043448.GB18332>