Re: panic upon kldunload snd_ich (lor # 159)

From: Pyun YongHyeon <pyunyh_at_gmail.com>
Date: Thu, 15 Sep 2005 13:34:48 +0900
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_at_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
Received on Thu Sep 15 2005 - 02:34:16 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:43 UTC